mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make sure we always have copies of equipment descriptions
Having pointers copied around that might get freed elsewhere could be a problem. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1055b5afd3
commit
8d766e13e2
4 changed files with 13 additions and 5 deletions
|
@ -271,7 +271,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 = cyl->type.description;
|
||||
currCylinderData.type = copy_string(cyl->type.description);
|
||||
currCylinderData.pressure = cyl->type.workingpressure.mbar;
|
||||
currCylinderData.size = cyl->type.size.mliter;
|
||||
return delegate;
|
||||
|
@ -323,7 +323,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 = ws->description;
|
||||
currWeight.type = copy_string(ws->description);
|
||||
currWeight.weight = ws->weight.grams;
|
||||
return editor;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue