mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't add cylinders and weightsystems past the MAX
We actually should disable the 'Add' button, I guess. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
04e59a0e1c
commit
482bea84c2
2 changed files with 8 additions and 0 deletions
|
@ -98,6 +98,7 @@ void CylindersModel::add(cylinder_t* cyl)
|
|||
{
|
||||
if (usedRows[current_dive] >= MAX_CYLINDERS) {
|
||||
free(cyl);
|
||||
return;
|
||||
}
|
||||
|
||||
int row = usedRows[current_dive];
|
||||
|
@ -203,6 +204,7 @@ void WeightModel::add(weightsystem_t* weight)
|
|||
{
|
||||
if (usedRows[current_dive] >= MAX_WEIGHTSYSTEMS) {
|
||||
free(weight);
|
||||
return;
|
||||
}
|
||||
|
||||
int row = usedRows[current_dive];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue