On 14 November 2014 19:57, Tomaz Canabrava <[email protected]> wrote:
> Looks like a bug that I should look at. Will see.
>

hey Tomaz,

i think i was able to find the cause, but the code is confusing me.

void MainTab::acceptChanges()
...
// copy the cylinder but make sure we have our own copy of the strings
free((void*)cd->cylinder[i].type.description); // <---------------

if the above free() call is removed the memory corruption is gone.

isn't it sufficient for that loop to simply be?:

for (int i = 0; i < MAX_CYLINDERS; i++) {
    cd->cylinder[i] = displayed_dive.cylinder[i];

perhaps i don't understand the difference between 'current_dive' and
'displayed_dive'...

lubomir
--
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to