[PATCH 4/5] Attempt to free plot data entries regardless of printer state

Lubomir I. Ivanov neolit123 at gmail.com
Sun Dec 16 16:37:44 PST 2012


On 17 December 2012 01:08, Linus Torvalds <torvalds at linux-foundation.org> wrote:
> On Sun, Dec 16, 2012 at 2:26 PM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>> From: "Lubomir I. Ivanov" <neolit123 at gmail.com>
>>
>> profile.c:plot() does take care of freeing the previously allocated array
>> of "struct plot_data" entries, but only if the "printer" flag in
>> gc (struct graphics_context) is set.
>
> This is wrong.
>
> We actually need the plot_data for the tooltip logic. Which is why
> it's only free'd for printers - which obviously don't have tooltips.
>
> We're supposed to free it on the next iteration when we create a new
> one, so that there is always just one "outstanding" allocation of
> plot_info values. But I didn't check if that's actually the case, I
> might have screwed that up.
>


aha, i see.
here is another quick attempt. attached patch is a replacement for
0004 (rebase).
i could only think of adding a static variable in profile.c that
remembers the last allocated address, though...
this has the tooltips working + no memory leaks.

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Attempt-to-free-plot-data-entries-in-each-call-to-cr.patch
Type: application/octet-stream
Size: 1701 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20121217/02d4ab52/attachment-0001.obj>


More information about the subsurface mailing list