mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Free memory returned from get_dive_gas_string
After we created a QString from it, we need to free the char*. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
da154222cc
commit
d812d7b1f6
1 changed files with 5 additions and 3 deletions
|
@ -1217,9 +1217,6 @@ QVariant DiveItem::data(int column, int role) const
|
|||
case CYLINDER:
|
||||
retVal = QString(dive->cylinder[0].type.description);
|
||||
break;
|
||||
case GAS:
|
||||
retVal = QString(get_dive_gas_string(dive));
|
||||
break;
|
||||
case SAC:
|
||||
retVal = displaySac();
|
||||
break;
|
||||
|
@ -1232,6 +1229,11 @@ QVariant DiveItem::data(int column, int role) const
|
|||
case LOCATION:
|
||||
retVal = QString(dive->location);
|
||||
break;
|
||||
case GAS:
|
||||
const char *gas_string = get_dive_gas_string(dive);
|
||||
retVal = QString(gas_string);
|
||||
free((void*)gas_string);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Qt::ToolTipRole:
|
||||
|
|
Loading…
Reference in a new issue