Closure usage in goffice



Hi,

I think there's a problem with the following code in
goffice/graph/gog-guru.c:

        /* remove the signal handlers when the guru goes away */
        closure = g_cclosure_new (G_CALLBACK (cb_obj_name_changed), s, NULL);
        g_object_watch_closure (G_OBJECT (s->prop_view), closure);
        g_signal_connect_closure (G_OBJECT (obj),
                "name-changed",
                closure, FALSE);
        closure = g_cclosure_new (G_CALLBACK (cb_obj_child_added), s, NULL);
        g_object_watch_closure (G_OBJECT (s->prop_view), closure);
        g_signal_connect_closure (G_OBJECT (obj),
                "child-added",
                closure, FALSE);
        closure = g_cclosure_new (G_CALLBACK (cb_obj_child_removed), s, NULL);
        g_object_watch_closure (G_OBJECT (s->prop_view), closure);
        g_signal_connect_closure (G_OBJECT (obj),
                "child-removed",
                closure, FALSE);

The problem here is closures are only invalidated when s->prop_view is
finalized, not finalized. Hence a memory leak since they stay in memory
until gnumeric process ends.

But I'm not sure how to fix this issue.

Any idea ?

        Emmanuel.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]