summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbok Lee <gilbok.lee@samsung.com>2017-02-02 14:38:33 +0900
committerGilbok Lee <gilbok.lee@samsung.com>2017-02-02 14:38:33 +0900
commitcfd077fe33013156438508a3dadf9050fcc79597 (patch)
tree4b753a1e5badf13a0bbece080ee9ca2c0eb4b490
parent8093452a10d40d764f039b1e2ad276e9e6891a5d (diff)
downloadlibmm-radio-cfd077fe33013156438508a3dadf9050fcc79597.tar.gz
libmm-radio-cfd077fe33013156438508a3dadf9050fcc79597.tar.bz2
libmm-radio-cfd077fe33013156438508a3dadf9050fcc79597.zip
Fix memory leak
[Version] 0.2.20 [Profile] Mobile, Wearable [Issue Type] Fix bugs Change-Id: Ie34d49b9f60218440fb2e6210161accbc2775ceb
-rwxr-xr-xpackaging/libmm-radio.spec2
-rw-r--r--src/mm_radio_sound_focus.c9
-rw-r--r--src/radio_hal_interface.c3
3 files changed, 10 insertions, 4 deletions
diff --git a/packaging/libmm-radio.spec b/packaging/libmm-radio.spec
index edc364d..6e5c404 100755
--- a/packaging/libmm-radio.spec
+++ b/packaging/libmm-radio.spec
@@ -1,6 +1,6 @@
Name: libmm-radio
Summary: Multimedia Framework Radio Library
-Version: 0.2.19
+Version: 0.2.20
Release: 0
Group: System/Libraries
License: Apache-2.0
diff --git a/src/mm_radio_sound_focus.c b/src/mm_radio_sound_focus.c
index cbfe624..68760dc 100644
--- a/src/mm_radio_sound_focus.c
+++ b/src/mm_radio_sound_focus.c
@@ -74,7 +74,6 @@ void _mmradio_sound_signal_callback(mm_sound_signal_name_t signal, int value, vo
/* unregister watch callback */
if (sound_focus->watch_id > 0) {
MMRADIO_LOG_DEBUG("unset the focus watch cb %d", sound_focus->watch_id);
-
ret = mm_sound_unset_focus_watch_callback(sound_focus->watch_id);
sound_focus->watch_id = 0;
if (ret != MM_ERROR_NONE)
@@ -82,6 +81,7 @@ void _mmradio_sound_signal_callback(mm_sound_signal_name_t signal, int value, vo
}
/* unregister focus callback */
if (sound_focus->focus_id > 0) {
+ MMRADIO_LOG_DEBUG("unset the focus %d", sound_focus->focus_id);
ret = mm_sound_unregister_focus(sound_focus->focus_id);
sound_focus->focus_id = 0;
if (ret != MM_ERROR_NONE)
@@ -129,7 +129,7 @@ int mmradio_sound_focus_register(mm_radio_sound_focus *sound_focus,
MMRADIO_LOG_ERROR("mm_sound_subscribe_signal is failed\n");
return MM_ERROR_POLICY_BLOCKED;
}
- MMRADIO_LOG_DEBUG("register focus watch callback for the value is 0, sub_cb id %d\n", sound_focus->subscribe_id);
+ MMRADIO_LOG_DEBUG("register mm_sound_subscribe_signal_for_daemon subscribe_id %d\n", sound_focus->subscribe_id);
/* register watch callback */
ret = mm_sound_set_focus_watch_callback_for_session(pid,
FOCUS_FOR_BOTH, watch_cb, (void *)param, &sound_focus->watch_id);
@@ -262,6 +262,11 @@ int mmradio_sound_focus_deregister(mm_radio_sound_focus *sound_focus)
MMRADIO_LOG_ERROR("failed to mm_sound_remove_device_connected_callback() ret = %d", ret);
}
+ if (sound_focus->subscribe_id > 0) {
+ MMRADIO_LOG_DEBUG("unset mm_sound_subscribe_signal_for_daemon %d", sound_focus->subscribe_id);
+ mm_sound_unsubscribe_signal(sound_focus->subscribe_id);
+ }
+
MMRADIO_LOG_FLEAVE();
return MM_ERROR_NONE;
diff --git a/src/radio_hal_interface.c b/src/radio_hal_interface.c
index 86b449b..567c469 100644
--- a/src/radio_hal_interface.c
+++ b/src/radio_hal_interface.c
@@ -133,7 +133,7 @@ int radio_hal_interface_init(mm_radio_hal_interface **handle)
*handle = h;
- MMRADIO_LOG_ERROR("open radio_hal interface");
+ MMRADIO_LOG_DEBUG("open radio_hal interface");
return MM_ERROR_NONE;
FAIL:
@@ -158,6 +158,7 @@ int radio_hal_interface_deinit(mm_radio_hal_interface *handle)
handle->rh_handle = NULL;
+ MMRADIO_LOG_DEBUG("close radio_hal interface");
dlclose(handle->dl_handle);
handle->dl_handle = NULL;
}