Planner TZ offset bug (and possible memory leak)
Lubomir I. Ivanov
neolit123 at gmail.com
Thu Jan 31 05:37:21 PST 2013
On 31 January 2013 15:25, Dirk Hohndel <dirk at hohndel.org> wrote:
> Sergey Starosek <sergey.starosek at gmail.com> writes:
>> It seems that planner calculates wrong TZ offset and thus planned dive
>> time is also wrong.
>> Given that currently I'm in EET (UTC+2), I started planning at 15:10
>> and 60min start offset.
>> That results in start dive time at 16:25 instead of 17:10.
>> I'm not so fluent in C and glib API but it seems that offset
>> calculation at planner.c:1054
>> int offset = g_time_zone_get_offset(g_time_zone_new_local(), 1);
>> and relying on interval = 1 is wrong.
>> Probably the correct way is to find it using something like
>> g_time_zone_find_interval(g_time_zone_new_local(), G_TIME_TYPE_UNIVERSAL, now);
>> Regarding memory leak, glib documentation says one should unref
>> GTimeZone received from
>> g_time_zone_new_local(). I observe memory growth by 8K from every
>> open/close planner
>> (judging from pmap output).
> I need to study the docs on that one again, I guess. Or maybe Lubomir
> wants to take over fixing bugs for a few hours. I have to give a
> presentation on Subsurface tomorrow at LCA and should try to be at least
> somewhat rested, I guess.
> Enough for tonight :-)
np, i will take a look at that later today.
More information about the subsurface