[vlc-devel] commit: vout: Make sure vout_Close() has been called before the object destruction. (Pierre d'Herbemont )

git version control git at videolan.org
Fri Jul 18 00:15:54 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Thu Jul 17 23:06:01 2008 +0200| [fbd86409a420fb3f62500e6b10f506d7698c679d]

vout: Make sure vout_Close() has been called before the object destruction.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fbd86409a420fb3f62500e6b10f506d7698c679d
---

 src/video_output/video_output.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index e0837c6..4b0744e 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -463,6 +463,7 @@ void vout_Close( vout_thread_t *p_vout )
     vlc_object_kill( p_vout );
     vlc_thread_join( p_vout );
     module_Unneed( p_vout, p_vout->p_module );
+    p_vout->p_module = NULL;
 }
 
 /* */
@@ -470,6 +471,9 @@ static void vout_Destructor( vlc_object_t * p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
 
+    /* Make sure the vout was stopped first */
+    assert( !p_vout->p_module );
+
     /* Destroy the locks */
     vlc_mutex_destroy( &p_vout->picture_lock );
     vlc_mutex_destroy( &p_vout->change_lock );




More information about the vlc-devel mailing list