summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/maintab.cpp')
-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()