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
Crash due to wl_frame_callback_handler()
called after window destruction
#24013
Comments
Thanks for reporting, I also found this issue recently as well. The problem was introduced by #23835 (included in wxWidgets 3.2.3) and it happens because I wrongly assumed that before the GTK widget's To fix it it should be enough to add a call to |
Ah, I see, thanks. This is indeed even better (and much easier to backport to 3.2) than using a weak reference, TIA! |
If the wxGLCanvas is destroyed immediately (without hiding it first), the GTKs widget's `unmap` signal which usually destroys the Wayland resources is not emitted. Thus, we need to ensure they are destroyed on the destructor instead. This fixes an use-after-free issue, sometimes causing a crash, because one of the leaked resources is the canvas's Wayland frame callback. Fixes wxWidgets#24013
If the wxGLCanvas is destroyed immediately (without hiding it first), the GTKs widget's `unmap` signal which usually destroys the Wayland resources is not emitted. Thus, we need to ensure they are destroyed on the destructor instead. This fixes an use-after-free issue, sometimes causing a crash, because one of the leaked resources is the canvas's Wayland frame callback. See wxWidgets#24013, wxWidgets#24016. (cherry picked from commit 22ae7a5)
Not sure when exactly was this introduced, but there is an easily reproducible crash in the cube sample:
Valgrind output showing more details
I'm going to fix this by using weak references to the canvas.
The text was updated successfully, but these errors were encountered: