Reply
Thread Tools
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#41
Another version (0.3.1) is out, another memory leak fixed.
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 9 Users Say Thank You to freemangordon For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#42
Originally Posted by freemangordon View Post
Another version (0.3.1) is out, another memory leak fixed.
Well spotted leak!
 

The Following User Says Thank You to reinob For This Useful Post:
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#43
Originally Posted by reinob View Post
Well spotted leak!
You looked at the commit?
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following User Says Thank You to freemangordon For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#44
Originally Posted by freemangordon View Post
You looked at the commit?
Obviously! do you think I trust you or what?! ))
 

The Following 4 Users Say Thank You to reinob For This Useful Post:
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#45
Originally Posted by reinob View Post
Obviously! do you think I trust you or what?! ))


The bad news is that it seems this is not the last one

I would appreciate if you (or someone else) help me find the remaining memory leaks.

The other thing that will be very useful, is a list of packages (if any) for which the guy that wrote the stock alarmUI is developer/maintainer. Those should be checked very carefully (if possible)
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 6 Users Say Thank You to freemangordon For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#46
@freemangordon,

in alarm_remove() you have:

Code:
    alarm_event_delete(a->alarm_event);
    g_slist_free(a->buttons);
    free(a);
    alarms = g_slist_remove(alarms,a);
    alarm_events_cnt--;
but you don't free the notification:
Code:
    alarm_event_delete(a->alarm_event);
    g_slist_free(a->buttons);
    if(a->notification) g_object_unref(G_OBJECT(a->notification))
    free(a);
    alarms = g_slist_remove(alarms,a);
    alarm_events_cnt--;
also, is it OK to free(a) before g_slist_remove(), I assume g_slist_remove doesn't use a (only the address, which is still there).
 

The Following 4 Users Say Thank You to reinob For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#47
also, in alarm_notify()

sound_file is a strdup'd and then sent to alarm_notify_notification_calendar(), which calls notify_notification_set_hint_string().

Immediately after that, sound_file is g_free()'d. Hopefully notify_notification_set_hint_string() makes a copy of it, as otherwise the pointer to the string will be invalid (hey, could be the reason for some calendar events not ringing
 

The Following 2 Users Say Thank You to reinob For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#48
in size_request_cb()

according to http://developer.gnome.org/pango/sta...rocessing.html, the object returned by pango_context_get_metrics has to be freed by the caller (pango_font_metrics_unref).

This is not the case. You can do it right after calculating "height".
 

The Following 5 Users Say Thank You to reinob For This Useful Post:
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#49
Originally Posted by reinob View Post
@freemangordon,

in alarm_remove() you have:

Code:
    alarm_event_delete(a->alarm_event);
    g_slist_free(a->buttons);
    free(a);
    alarms = g_slist_remove(alarms,a);
    alarm_events_cnt--;
but you don't free the notification:
Code:
    alarm_event_delete(a->alarm_event);
    g_slist_free(a->buttons);
    if(a->notification) g_object_unref(G_OBJECT(a->notification))
    free(a);
    alarms = g_slist_remove(alarms,a);
    alarm_events_cnt--;
by the time alarm_remove is called, a->notification should be unreffed and NULL already. Though I will put some check for that, thanks.

also, is it OK to free(a) before g_slist_remove(), I assume g_slist_remove doesn't use a (only the address, which is still there).
it is ok, list contains only the address, it does not care what is behind this address
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 4 Users Say Thank You to freemangordon For This Useful Post:
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#50
Originally Posted by reinob View Post
also, in alarm_notify()

sound_file is a strdup'd and then sent to alarm_notify_notification_calendar(), which calls notify_notification_set_hint_string().

Immediately after that, sound_file is g_free()'d. Hopefully notify_notification_set_hint_string() makes a copy of it, as otherwise the pointer to the string will be invalid (hey, could be the reason for some calendar events not ringing
This one is ok too, notify_notification_set_hint_string() uses g_value_set_string(), which makes a copy.
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 3 Users Say Thank You to freemangordon For This Useful Post:
Reply

Tags
alarm clock, nokia n9


 
Forum Jump


All times are GMT. The time now is 22:27.