foliate icon indicating copy to clipboard operation
foliate copied to clipboard

Memory leaks

Open johnfactotum opened this issue 7 months ago • 0 comments

Describe the bug Many widgets in Foliate are leaking.

To Reproduce

  1. Run Foliate with GOBJECT_DEBUG=instance-count
  2. Open GTK inspector
  3. Open and close books multiple times
  4. 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.

johnfactotum avatar Nov 13 '23 11:11 johnfactotum