foliate
foliate copied to clipboard
Memory leaks
Describe the bug Many widgets in Foliate are leaking.
To Reproduce
- Run Foliate with
GOBJECT_DEBUG=instance-count
- Open GTK inspector
- Open and close books multiple times
- See that, for many objects, the count never decreases
Expected behavior It should not leak.
Version:
- Foliate version: 3.0.0
- Installation method: Flatpak
Additional context
Currently it calls run_dispose()
for the WebView. But for everything else, if there's ever a signal connection or something, the object will never get disposed.
To fix this I think it should disconnect everything in vfunc_unroot()
. But that's terribly inconvenient. It seems that GJS is getting a connect_object
method. So probably can just use that.