mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: fix leak in delegates
A copy of a C-string was assigned to a QString. The copy was never freed. Instead, assign the C-string directly. This does the right thing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
cab0147093
commit
7b83eeadff
1 changed files with 2 additions and 2 deletions
|
@ -294,7 +294,7 @@ QWidget *TankInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
|
|||
QWidget *delegate = ComboBoxDelegate::createEditor(parent, option, index);
|
||||
CylindersModel *mymodel = qobject_cast<CylindersModel *>(currCombo.model);
|
||||
cylinder_t *cyl = mymodel->cylinderAt(index);
|
||||
currCylinderData.type = copy_string(cyl->type.description);
|
||||
currCylinderData.type = cyl->type.description;
|
||||
currCylinderData.pressure = cyl->type.workingpressure.mbar;
|
||||
currCylinderData.size = cyl->type.size.mliter;
|
||||
MainWindow::instance()->graphics->setReplot(false);
|
||||
|
@ -372,7 +372,7 @@ QWidget *WSInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewIte
|
|||
QWidget *editor = ComboBoxDelegate::createEditor(parent, option, index);
|
||||
WeightModel *mymodel = qobject_cast<WeightModel *>(currCombo.model);
|
||||
weightsystem_t *ws = mymodel->weightSystemAt(index);
|
||||
currWeight.type = copy_string(ws->description);
|
||||
currWeight.type = ws->description;
|
||||
currWeight.weight = ws->weight.grams;
|
||||
return editor;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue