[vlc-devel] commit: macosx: Fix a couple of object leak in the equalizer. (Pierre d' Herbemont )

git version control git at videolan.org
Fri Aug 15 13:37:46 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Fri Aug 15 13:40:22 2008 +0200| [f1136a8c07acd0a3b16915f700221c6218fea965] | committer: Pierre d'Herbemont 

macosx: Fix a couple of object leak in the equalizer.

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

 modules/gui/macosx/equalizer.m |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/equalizer.m b/modules/gui/macosx/equalizer.m
index 68d6e9d..78adadd 100644
--- a/modules/gui/macosx/equalizer.m
+++ b/modules/gui/macosx/equalizer.m
@@ -52,8 +52,10 @@ static void ChangeFiltersString( intf_thread_t *p_intf,
     vlc_object_t *p_object = vlc_object_find( p_intf,
                                 VLC_OBJECT_AOUT, FIND_ANYWHERE );
     aout_instance_t *p_aout = (aout_instance_t *)p_object;
-    if( p_object == NULL )
+    if( !p_object )
+    {
         p_object = (vlc_object_t *)pl_Yield( p_intf );
+    }
 
     psz_string = var_GetNonEmptyString( p_object, "audio-filter" );
 
@@ -72,6 +74,7 @@ static void ChangeFiltersString( intf_thread_t *p_intf,
         }
         else
         {
+            vlc_object_release( p_object );
             return;
         }
     }
@@ -90,8 +93,9 @@ static void ChangeFiltersString( intf_thread_t *p_intf,
          }
          else
          {
-             free( psz_string );
-             return;
+            free( psz_string );
+            vlc_object_release( p_object );
+            return;
          }
     }
 




More information about the vlc-devel mailing list