summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-17 12:07:49 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-25 22:13:17 +0100
commite45767b00443e7a5ea3a13e22b9620f6eedc872e (patch)
tree0456a45b448c33aa1c9e6dc7d7f20a51f1cd8b3f
parentd10882ef141579239a585ba9610dfa524e8685c9 (diff)
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 <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11533
-rw-r--r--src/lib/edje/edje_multisense.c6
1 files changed, 6 insertions, 0 deletions
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 @@
5 5
6static Eo *out = NULL; 6static Eo *out = NULL;
7static int outs = 0; 7static int outs = 0;
8static Eina_List *ins = NULL;
8static Eina_Bool outfail = EINA_FALSE; 9static Eina_Bool outfail = EINA_FALSE;
9 10
10static void 11static void
11_play_finished(void *data EINA_UNUSED, const Efl_Event *event) 12_play_finished(void *data EINA_UNUSED, const Efl_Event *event)
12{ 13{
14 ins = eina_list_remove(ins, event->object);
13 efl_unref(event->object); 15 efl_unref(event->object);
14} 16}
15 17
@@ -245,6 +247,7 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c
245 efl_unref(in); 247 efl_unref(in);
246 return EINA_FALSE; 248 return EINA_FALSE;
247 } 249 }
250 ins = eina_list_append(ins, in);
248 } 251 }
249 } 252 }
250 return EINA_TRUE; 253 return EINA_TRUE;
@@ -348,6 +351,7 @@ void
348_edje_multisense_shutdown(void) 351_edje_multisense_shutdown(void)
349{ 352{
350#ifdef ENABLE_MULTISENSE 353#ifdef ENABLE_MULTISENSE
354 Eo *in;
351 if (outs > 0) 355 if (outs > 0)
352 { 356 {
353 WRN("Shutting down audio while samples still playing"); 357 WRN("Shutting down audio while samples still playing");
@@ -358,6 +362,8 @@ _edje_multisense_shutdown(void)
358 out = NULL; 362 out = NULL;
359 outs = 0; 363 outs = 0;
360 } 364 }
365 EINA_LIST_FREE(ins, in)
366 efl_unref(in);
361 ecore_audio_shutdown(); 367 ecore_audio_shutdown();
362#endif 368#endif
363} 369}