From e7b84233af14723814f1340010bb86c6801f1e06 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 21 May 2013 10:07:41 -0300 Subject: Fixed memory leak Signed-off-by: Tomaz Canabrava --- qt-ui/maintab.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qt-ui/maintab.cpp') 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() -- cgit v1.2.3-70-g09d2