Public bug reported:

Binary package hint: appmenu-gtk

The rebuild function creates a hash table mapping the toplevel to the
g_timeout id responsible for doing the refresh.

The rebuild function allocates a RebuildData object to pass to the
do_rebuild idle function. The do_rebuild callback function frees this
object when it is called.

However, the do_rebuild function isn't guaranteed to be called. In fact
the whole point of the hash table seems to be that the callback can be
canceled. When that happens, the RebuildData object isn't freed, causing
a leak.

Additionally, instead of storing a proper reference to the toplevel in
the RebuldData object, a weak pointer is stored instead. But if the weak
pointer gets set to null, the do_rebuld function will lose its only copy
of that pointer, so it will have no way of cleaning up the associated
entry in the hash table.

** Affects: appmenu-gtk (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/787736

Title:
  memory leak in rebuild

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to