bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c697965a8c72e13be834b5a1e10dc5ff8d4766ea

commit c697965a8c72e13be834b5a1e10dc5ff8d4766ea
Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Mar 17 12:03:03 2020 -0400

    ecore/audio: free vio on in/out object destruction
    
    ensure we don't leak these since that means we also leak the user's free
    data and callback
    
    Reviewed-by: Marcel Hollerbach <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11527
---
 src/lib/ecore_audio/ecore_audio_obj_in.c  | 8 +++++++-
 src/lib/ecore_audio/ecore_audio_obj_out.c | 4 +++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c 
b/src/lib/ecore_audio/ecore_audio_obj_in.c
index dcb792c8af..64ce45ba54 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.c
@@ -187,9 +187,15 @@ _ecore_audio_in_efl_object_constructor(Eo *eo_obj, 
Ecore_Audio_Input *obj)
 EOLIAN static void
 _ecore_audio_in_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Input *obj)
 {
+  Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
   if(obj->output)
-    ecore_audio_obj_out_input_detach(obj->output, eo_obj);
+    {
+       if (!ecore_audio_obj_out_input_detach(obj->output, eo_obj))
+         ERR("Failed to detach output %p!", obj->output);
+    }
 
+  if (ea_obj->vio)
+    _free_vio(ea_obj);
   efl_destructor(efl_super(eo_obj, MY_CLASS));
 }
 
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out.c 
b/src/lib/ecore_audio/ecore_audio_obj_out.c
index 4c05b218da..7a51e8c73d 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out.c
@@ -147,11 +147,13 @@ _ecore_audio_out_efl_object_destructor(Eo *eo_obj, 
Ecore_Audio_Output *obj)
 {
   Eina_List *cur, *tmp;
   Eo *in;
+  Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
 
   EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) {
       ecore_audio_obj_out_input_detach(eo_obj, in);
   }
-
+  if (ea_obj->vio)
+    _free_vio(ea_obj);
   efl_destructor(efl_super(eo_obj, MY_CLASS));
 }
 

-- 


Reply via email to