summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-17 12:03:03 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-25 22:13:02 +0100
commitc697965a8c72e13be834b5a1e10dc5ff8d4766ea (patch)
tree140b65f8eab38267d850275bed14397d4d8dcc12
parente8eb67a557485caaca3733ae66f4da4c36517134 (diff)
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 <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11527
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c8
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out.c4
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)
187EOLIAN static void 187EOLIAN static void
188_ecore_audio_in_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Input *obj) 188_ecore_audio_in_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Input *obj)
189{ 189{
190 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
190 if(obj->output) 191 if(obj->output)
191 ecore_audio_obj_out_input_detach(obj->output, eo_obj); 192 {
193 if (!ecore_audio_obj_out_input_detach(obj->output, eo_obj))
194 ERR("Failed to detach output %p!", obj->output);
195 }
192 196
197 if (ea_obj->vio)
198 _free_vio(ea_obj);
193 efl_destructor(efl_super(eo_obj, MY_CLASS)); 199 efl_destructor(efl_super(eo_obj, MY_CLASS));
194} 200}
195 201
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)
147{ 147{
148 Eina_List *cur, *tmp; 148 Eina_List *cur, *tmp;
149 Eo *in; 149 Eo *in;
150 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
150 151
151 EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) { 152 EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) {
152 ecore_audio_obj_out_input_detach(eo_obj, in); 153 ecore_audio_obj_out_input_detach(eo_obj, in);
153 } 154 }
154 155 if (ea_obj->vio)
156 _free_vio(ea_obj);
155 efl_destructor(efl_super(eo_obj, MY_CLASS)); 157 efl_destructor(efl_super(eo_obj, MY_CLASS));
156} 158}
157 159