Planner TZ offset bug (and possible memory leak)

Sergey Starosek sergey.starosek at gmail.com
Thu Jan 31 05:16:22 PST 2013


Hi,

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).

Sergey


More information about the subsurface mailing list