summaryrefslogtreecommitdiff
path: root/src/mm_radio_priv_hal.c
diff options
context:
space:
mode:
authorGilbok Lee <gilbok.lee@samsung.com>2018-04-25 10:51:36 +0900
committerGilbok Lee <gilbok.lee@samsung.com>2018-04-25 06:27:27 +0000
commitafe8eb8c5e8124f6140813c758d460dd3be8849d (patch)
treeab251e0cff44881335e2b66302c7d9202f5745d4 /src/mm_radio_priv_hal.c
parentcc9cd23fde25c4756919d55eb62d4761fd51efcc (diff)
downloadlibmm-radio-afe8eb8c5e8124f6140813c758d460dd3be8849d.tar.gz
libmm-radio-afe8eb8c5e8124f6140813c758d460dd3be8849d.tar.bz2
libmm-radio-afe8eb8c5e8124f6140813c758d460dd3be8849d.zip
Add null check when destroy sound manager vstream
[Version] 0.2.39 [Profile] Mobile, Wearable [Issue Type] Fix bug Change-Id: I5ecf00204dd228d609799b66b24e0a0e497bc2f8
Diffstat (limited to 'src/mm_radio_priv_hal.c')
-rw-r--r--src/mm_radio_priv_hal.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mm_radio_priv_hal.c b/src/mm_radio_priv_hal.c
index 3d1f8d6..ac1cd92 100644
--- a/src/mm_radio_priv_hal.c
+++ b/src/mm_radio_priv_hal.c
@@ -196,6 +196,8 @@ int _mmradio_create_radio(mm_radio_t *radio)
radio->freq = DEFAULT_FREQ;
memset(&radio->region_setting, 0, sizeof(MMRadioRegion_t));
radio->local_volume = 1.0;
+ radio->vstream = NULL;
+ radio->stream_info = NULL;
/* create msg queue for msg thread */
radio->msg_queue = g_async_queue_new();
@@ -329,8 +331,14 @@ int _mmradio_unrealize(mm_radio_t *radio)
_mmradio_stop(radio);
#ifdef TIZEN_FEATURE_SOUND_VSTREAM
- sound_manager_destroy_virtual_stream(radio->vstream);
- sound_manager_destroy_stream_information(radio->stream_info);
+ if (radio->vstream) {
+ sound_manager_destroy_virtual_stream(radio->vstream);
+ radio->vstream = NULL;
+ }
+ if (radio->stream_info) {
+ sound_manager_destroy_stream_information(radio->stream_info);
+ radio->stream_info = NULL;
+ }
#endif
MMRADIO_SET_STATE(radio, MM_RADIO_STATE_NULL);