Skip to content

Commit afbf19c

Browse files
committed
clear labels container, not just pointer memory
1 parent 96eabeb commit afbf19c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

SOLUTIONS/Exercise 10.1.2/CardGameGUI/blackjack.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void BlackJack::refreshImages(CardHand *hand, QList<QLabel*> &labels, QGridLayou
125125
{
126126
if(!labels.isEmpty()) {
127127
qDeleteAll(labels);
128+
labels.clear();
128129
}
129130

130131
labels = hand->getLabels();

SOLUTIONS/Exercise 10.1.2/CardGameGUI/blackjack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BlackJack : public QMainWindow
1919
explicit BlackJack(QWidget *parent = 0);
2020
~BlackJack();
2121
void handOver();
22-
// delete and readd images
22+
// delete and read images
2323
void refreshImages(CardHand *hand, QList<QLabel *> &labels, QGridLayout *layout);
2424

2525
private slots:

SOLUTIONS/Exercise 10.1.2/CardGameGUI/blackjack.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</size>
1818
</property>
1919
<property name="windowTitle">
20-
<string>MainWindow</string>
20+
<string>Basic Black Jack</string>
2121
</property>
2222
<widget class="QWidget" name="centralwidget">
2323
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="3,1">

0 commit comments

Comments
 (0)