[gtk+] Use the new api to release resources



commit 47b7bfd2ba5e5cd4ca2873021c2fdc5ce148812d
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 17 20:19:19 2018 -0500

    Use the new api to release resources
    
    When we unrealize a GL area with outstanding textures,
    call gdk_texture_release_gl on them to avoid later crashes.

 gtk/gtkglarea.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index f6254cf..d7e727b 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -385,11 +385,15 @@ delete_one_texture (gpointer data)
 {
   Texture *texture = data;
 
+  if (texture->holder)
+    gdk_texture_release_gl (texture->holder);
+
   if (texture->id != 0)
     {
       glDeleteTextures (1, &texture->id);
       texture->id = 0;
     }
+
   g_free (texture);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]