diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-21 10:07:41 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-21 10:07:41 -0300 |
commit | e7b84233af14723814f1340010bb86c6801f1e06 (patch) | |
tree | 3d5747223019ac1683ae17ee0808fbc6ac4bf870 | |
parent | be31a53b0d7090083f8b3a2ed923d0ed8b61000f (diff) | |
download | subsurface-e7b84233af14723814f1340010bb86c6801f1e06.tar.gz |
Fixed memory leak
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r-- | qt-ui/maintab.cpp | 8 |
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() |