]> git.sesse.net Git - vlc/blobdiff - modules/gui/minimal_macosx/VLCOpenGLVoutView.m
Move most of the parameters out of p_sys.
[vlc] / modules / gui / minimal_macosx / VLCOpenGLVoutView.m
index 8b50b4250c9c21b198e5e16991735bbbcbbb2314..4fa69c12fa0202e03584b490e844767a1017b6e0 100644 (file)
@@ -54,7 +54,9 @@ int cocoaglvoutviewInit( vout_thread_t * p_vout )
 
     p_vout->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
 
-    o_cocoaglview_container = (id) value_drawable.p_address;
+    /* This will be released in cocoaglvoutviewEnd(), on
+     * main thread, after we are done using it. */
+    o_cocoaglview_container = [(id) value_drawable.p_address retain];
     if (!o_cocoaglview_container)
     {
         msg_Warn( p_vout, "No drawable!, spawing a window" );
@@ -99,6 +101,9 @@ void cocoaglvoutviewEnd( vout_thread_t * p_vout )
     [p_vout->p_sys->o_glview performSelectorOnMainThread:@selector(removeFromSuperviewAndRelease) withObject:nil waitUntilDone:NO];
     p_vout->p_sys->o_glview = nil;
 
+    /* Release the container now that we don't use it */
+    [o_cocoaglview_container performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];
+
     [p_vout->p_sys->o_pool release];
     p_vout->p_sys->o_pool = nil;
  
@@ -289,7 +294,6 @@ void cocoaglvoutviewUnlock( vout_thread_t * p_vout )
     [objectLock lock];
     if( p_vout )
     {
-        vlc_object_detach( p_vout );
         vlc_object_release( p_vout );
         vlc_object_release( p_vout );
     }