Fixed memory leaks in the "40000 chips" example.
Two QObjects had no parent. This caused memory leaks on app close. Confirmed with the valgrind memory analyzer tool from Qt Creator. Change-Id: I9294099ca819be1a9c5b74b3cec5bf197be06433 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
bbe65832f5
commit
a7db6e3467
@ -76,7 +76,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
void MainWindow::populateScene()
|
||||
{
|
||||
scene = new QGraphicsScene;
|
||||
scene = new QGraphicsScene(this);
|
||||
|
||||
QImage image(":/qt4logo.png");
|
||||
|
||||
|
@ -147,7 +147,7 @@ View::View(const QString &name, QWidget *parent)
|
||||
printButton = new QToolButton;
|
||||
printButton->setIcon(QIcon(QPixmap(":/fileprint.png")));
|
||||
|
||||
QButtonGroup *pointerModeGroup = new QButtonGroup;
|
||||
QButtonGroup *pointerModeGroup = new QButtonGroup(this);
|
||||
pointerModeGroup->setExclusive(true);
|
||||
pointerModeGroup->addButton(selectModeButton);
|
||||
pointerModeGroup->addButton(dragModeButton);
|
||||
|
Loading…
x
Reference in New Issue
Block a user