fix: Finalize AvatarBox correctly
Widgets will remove all event controllers automatically when they are destroyed, however, the GestureClick still hold a reference to the connected function leading to a leak.
Test Plan
- Open Gajim with
export GAJIM_LEAK=1
- Open a chat
- Switch between this chat and another chat
There are several ways to measure the impact: I've checked both htop (reserved memory column) and used memray
. Here are the numbers for the latter:
- Before: I've roughly measured 1.4 MB per switch between Gajim's and Conversation's MUC
- After: 0.4 MB leak per chat switch
averaged over 50 switches.
Edited by mesonium