GeopJr / Tuba

Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
519 stars 57 forks source link

fix(MainWindow): check if last_widget is a GtkWidget before using #1061

Closed GeopJr closed 3 weeks ago

GeopJr commented 3 weeks ago

Turns out that checking if last_widget (weak ref) is null is not enough, we actually have to check if it's also a widget.

Turns out that using weak ref at all is segfaulty :shrug: let's just use a normal ref and hope for no memory leaks (couldn't find any in my testing, we do try to clear the ref as often as possible (after the focus has been used, when the model gets cleared))

On my side, that resulted in a CRITICAL, but it turns out it can segfault too

fix: #1059

When I'm in a 'why is this happening' competition and my opponent is vala