[cogl/wip/rib/cogl-1.12: 141/142] onscreen: Free swap notify callback state



commit 46361831ab06d36194ad43ca3495bef21840cdbe
Author: Robert Bragg <robert linux intel com>
Date:   Wed Jun 20 19:03:33 2012 +0100

    onscreen: Free swap notify callback state
    
    When freeing a CoglOnscreen we weren't freeing the state associated with
    swap notification callbacks.
    
    Reviewed-by: Neil Roberts <neil linux intel com>
    
    (cherry picked from commit 70bc12fe20fa1be4eac58356861a730f18d6b59e)

 cogl/cogl-onscreen.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-onscreen.c b/cogl/cogl-onscreen.c
index ad8232c..4aaa5de 100644
--- a/cogl/cogl-onscreen.c
+++ b/cogl/cogl-onscreen.c
@@ -115,6 +115,7 @@ _cogl_onscreen_free (CoglOnscreen *onscreen)
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
   const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
   CoglResizeNotifyEntry *resize_entry;
+  CoglSwapBuffersNotifyEntry *swap_entry;
 
   while ((resize_entry = COGL_TAILQ_FIRST (&onscreen->resize_callbacks)))
     {
@@ -122,6 +123,12 @@ _cogl_onscreen_free (CoglOnscreen *onscreen)
       g_slice_free (CoglResizeNotifyEntry, resize_entry);
     }
 
+  while ((swap_entry = COGL_TAILQ_FIRST (&onscreen->swap_callbacks)))
+    {
+      COGL_TAILQ_REMOVE (&onscreen->swap_callbacks, swap_entry, list_node);
+      g_slice_free (CoglSwapBuffersNotifyEntry, swap_entry);
+    }
+
   if (framebuffer->context->window_buffer == COGL_FRAMEBUFFER (onscreen))
     framebuffer->context->window_buffer = NULL;
 



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