opengl: fix an crash/hang on exit because opengl needs the init and end to be done...
authorRémi Duraffort <ivoire@videolan.org>
Wed, 22 Jul 2009 08:48:46 +0000 (10:48 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 22 Jul 2009 18:24:26 +0000 (20:24 +0200)
modules/video_output/opengl.c

index d6592a9..04432a0 100644 (file)
@@ -388,6 +388,11 @@ static void End( vout_thread_t *p_vout )
     {
         p_sys->p_vout->pf_unlock( p_sys->p_vout );
     }
+
+    /* We must release the opengl provider here: opengl requiere init and end
+       to be done in the same thread */
+    module_unneed( p_sys->p_vout, p_sys->p_vout->p_module );
+    vlc_object_release( p_sys->p_vout );
 }
 
 /*****************************************************************************
@@ -400,9 +405,6 @@ static void DestroyVout( vlc_object_t *p_this )
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
     vout_sys_t *p_sys = p_vout->p_sys;
 
-    module_unneed( p_sys->p_vout, p_sys->p_vout->p_module );
-    vlc_object_release( p_sys->p_vout );
-
     free( p_sys );
 }