]> git.sesse.net Git - vlc/commitdiff
Memleak
authorClément Stenac <zorglub@videolan.org>
Sat, 4 Feb 2006 17:08:44 +0000 (17:08 +0000)
committerClément Stenac <zorglub@videolan.org>
Sat, 4 Feb 2006 17:08:44 +0000 (17:08 +0000)
src/misc/messages.c

index 3d37972f7b066ebae7c0ae95f8b3f07f2ccf6a8f..9aeba8e320631baf3db1f5b9519729b645dee988 100644 (file)
@@ -133,7 +133,7 @@ void __msg_Flush( vlc_object_t *p_this )
 void __msg_Destroy( vlc_object_t *p_this )
 {
     int i;
-    for( i =  0 ; i < p_this->p_libvlc->msg_bank.i_queues; i++ )
+    for( i = p_this->p_libvlc->msg_bank.i_queues -1 ; i >= 0;  i-- )
     {
         msg_queue_t *p_queue = p_this->p_libvlc->msg_bank.pp_queues[i];
         if( p_queue->i_sub )
@@ -148,6 +148,9 @@ void __msg_Destroy( vlc_object_t *p_this )
 #endif
         /* Destroy lock */
         vlc_mutex_destroy( &p_queue->lock );
+        REMOVE_ELEM( p_this->p_libvlc->msg_bank.pp_queues,
+                     p_this->p_libvlc->msg_bank.i_queues, i );
+        free( p_queue );
     }
     vlc_mutex_destroy( &(p_this->p_libvlc->msg_bank.lock) );
 }