gl/cocoa: use NSAutoreleasePool to free resize data
authorJulien Isorce <julien.isorce@gmail.com>
Mon, 3 Nov 2014 23:24:33 +0000 (23:24 +0000)
committerJulien Isorce <julien.isorce@gmail.com>
Mon, 3 Nov 2014 23:24:33 +0000 (23:24 +0000)
Otherwise when resizing the window you will also get messages like:
class NSConcreteMapTable autoreleased with no pool in place - just leaking
class NSConcreteValue autoreleased with no pool in place - just leaking
class NSConcreteValue autoreleased with no pool in place - just leaking
class __NSCFDictionary autoreleased with no pool in place - just leaking

gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m

index cac72e6..0771662 100644 (file)
@@ -514,6 +514,7 @@ struct resize
 static void
 resize_cb (gpointer data)
 {
+  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   struct resize *resize_data = data;
   GstGLWindowCocoa *window_cocoa = resize_data->window;
   GstGLWindow *window = GST_GL_WINDOW (window_cocoa);
@@ -540,6 +541,7 @@ resize_cb (gpointer data)
     [glContext flushBuffer];
   }
   gst_object_unref (context);
+  [pool release];
 }
 
 - (void)renewGState {