summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-21 10:07:41 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-21 10:07:41 -0300
commite7b84233af14723814f1340010bb86c6801f1e06 (patch)
tree3d5747223019ac1683ae17ee0808fbc6ac4bf870 /qt-ui
parentbe31a53b0d7090083f8b3a2ed923d0ed8b61000f (diff)
downloadsubsurface-e7b84233af14723814f1340010bb86c6801f1e06.tar.gz
Fixed memory leak
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 848f068a2..10645c12f 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -246,17 +246,17 @@ void MainTab::on_addCylinder_clicked()
return;
AddCylinderDialog dialog(this);
- cylinder_t *newCylinder = (cylinder_t*) malloc(sizeof(cylinder_t));
- newCylinder->type.description = "";
+ cylinder_t newCylinder;
+ newCylinder.type.description = "";
- dialog.setCylinder(newCylinder);
+ dialog.setCylinder(&newCylinder);
int result = dialog.exec();
if (result == QDialog::Rejected) {
return;
}
dialog.updateCylinder();
- cylindersModel->add(newCylinder);
+ cylindersModel->add(&newCylinder);
}
void MainTab::on_editCylinder_clicked()