testing the planner + some questions/considerations

Lubomir I. Ivanov neolit123 at gmail.com
Thu Dec 12 08:14:24 UTC 2013


i've been testing a planner and it seems stable, but there are leaks
from these calls when doing a:
'log -> add dive' and then 'cancel'. this obviously can wait post 4.0,
but if someone is interested you can take a look:

fill_default_cylinder()
copy_samples()

which means that we create a temporary dive but then don't free it properly.

i'm confused by the 3 different dives needed: current_dive (ok, this
should be the one shown in the info dialog, re: GTK), stagingDive and
tempDive, so tried different things to solve the leak in cancelPlan(),
but got lost.

also here is a patch that i did (attachment), which should follow the
correct logic for dives, i would think and which is - all (char *) in
'struct dive' and it's children struct should be strdup()-ed?

which leads to copy_cylinders() and i know it's only used in the
planner, but if the user entered some cyl. description and we copy
with:
for (i = 0; i < MAX_CYLINDERS; i++)
d->cylinder[i] = s->cylinder[i];

and then decide to free all strings for a dive, wouldn't that be
disruptive to the dive that was the destination in copy_cylinders()?

/more like brain-spaz rather than a brain-storm

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-divelist.c-fix-possible-mem.leaks-in-delete_single_d.patch
Type: application/octet-stream
Size: 1083 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131212/614e4a7c/attachment.obj>


More information about the subsurface mailing list