Browse Source

Wayland+GLUT: fix crash in glut_test application - cont'd

darkmode
ManoloFLTK 2 years ago
parent
commit
36d34983bb
  1. 3
      src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
  2. 3
      src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx

3
src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx

@ -263,6 +263,9 @@ void Fl_Wayland_Gl_Window_Driver::delete_gl_context(GLContext context) { @@ -263,6 +263,9 @@ void Fl_Wayland_Gl_Window_Driver::delete_gl_context(GLContext context) {
cached_context = 0;
cached_window = 0;
}
if (eglGetCurrentContext() == (EGLContext)context) {
eglMakeCurrent(egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
}
eglDestroyContext(egl_display, (EGLContext)context);
eglDestroySurface(egl_display, egl_surface);
egl_surface = NULL;

3
src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx

@ -1279,8 +1279,7 @@ static const struct wl_callback_listener sync_listener = { @@ -1279,8 +1279,7 @@ static const struct wl_callback_listener sync_listener = {
static void do_atexit() {
if (Fl_Wayland_Screen_Driver::wl_display &&
(!Fl::first_window() || !Fl::first_window()->as_gl_window())) {
if (Fl_Wayland_Screen_Driver::wl_display) {
wl_display_roundtrip(Fl_Wayland_Screen_Driver::wl_display);
}
}

Loading…
Cancel
Save