bu5hm4n pushed a commit to branch master.

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

commit e45767b00443e7a5ea3a13e22b9620f6eedc872e
Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Mar 17 12:07:49 2020 -0400

    edje/multisense: track and destroy multisense inputs on shutdown
    
    leaking these means leaking file references, and there's no reason for it
    
    Reviewed-by: Marcel Hollerbach <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11533
---
 src/lib/edje/edje_multisense.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/lib/edje/edje_multisense.c b/src/lib/edje/edje_multisense.c
index b1575f464c..1bbb457ae3 100644
--- a/src/lib/edje/edje_multisense.c
+++ b/src/lib/edje/edje_multisense.c
@@ -5,11 +5,13 @@
 
 static Eo *out = NULL;
 static int outs = 0;
+static Eina_List *ins = NULL;
 static Eina_Bool outfail = EINA_FALSE;
 
 static void
 _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
 {
+   ins = eina_list_remove(ins, event->object);
    efl_unref(event->object);
 }
 
@@ -245,6 +247,7 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const 
char *sample_name, c
                   efl_unref(in);
                   return EINA_FALSE;
                }
+             ins = eina_list_append(ins, in);
           }
      }
    return EINA_TRUE;
@@ -348,6 +351,7 @@ void
 _edje_multisense_shutdown(void)
 {
 #ifdef ENABLE_MULTISENSE
+   Eo *in;
    if (outs > 0)
      {
         WRN("Shutting down audio while samples still playing");
@@ -358,6 +362,8 @@ _edje_multisense_shutdown(void)
         out = NULL;
         outs = 0;
      }
+   EINA_LIST_FREE(ins, in)
+     efl_unref(in);
    ecore_audio_shutdown();
 #endif
 }

-- 


Reply via email to