Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jul 14, 2024

Conversation

GeopJr
Copy link
Owner

@GeopJr GeopJr commented Jul 9, 2024

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 🤷 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

@GeopJr GeopJr force-pushed the fix/focus-segfault branch from f1c8b09 to ec39d9a Compare July 9, 2024 19:41
@GeopJr GeopJr merged commit 44369d0 into main Jul 14, 2024
5 checks passed
@GeopJr GeopJr deleted the fix/focus-segfault branch July 14, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Crashes when going to previous screen after destroy event
1 participant