From: Sangchul Lee Date: Thu, 19 Jan 2017 07:55:41 +0000 (+0900) Subject: Reset __mpEventListener member in finalize X-Git-Tag: accepted/tizen/3.0/common/20170124.081310~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=874db187eef5ef9cdb5269d6e64d8e221c545237;p=platform%2Fcore%2Fapi%2Faudio-io.git Reset __mpEventListener member in finalize [Version] 0.3.55 [Profile] Common [Issue Type] Fix Bug (seg.fault) Change-Id: Ic653893fabace43dddbf0e1f2aa784b8aea950ca Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-audio-io.spec b/packaging/capi-media-audio-io.spec index 3bc2213..1e528e2 100644 --- a/packaging/capi-media-audio-io.spec +++ b/packaging/capi-media-audio-io.spec @@ -1,6 +1,6 @@ Name: capi-media-audio-io Summary: An Audio Input & Audio Output library in Tizen Native API -Version: 0.3.54 +Version: 0.3.55 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/cpp/CAudioSessionHandler.cpp b/src/cpp/CAudioSessionHandler.cpp index d8fe72a..8b9713c 100644 --- a/src/cpp/CAudioSessionHandler.cpp +++ b/src/cpp/CAudioSessionHandler.cpp @@ -190,9 +190,8 @@ void CAudioSessionHandler::__sound_pcm_signal_cb(mm_sound_signal_name_t signal, AUDIO_IO_LOGD("[signal:%d], [value:%d], [user_data:0x%x]", signal, value, user_data); CAudioSessionHandler* pHandler = static_cast(user_data); - if (pHandler->__mpEventListener != NULL) { + if (pHandler->__mpEventListener != NULL) pHandler->__mpEventListener->onSignal(pHandler, signal, value); - } } void CAudioSessionHandler::initialize() throw(CAudioError) { @@ -269,6 +268,8 @@ void CAudioSessionHandler::finalize() { mm_sound_unsubscribe_signal(__mSubscribeId); } + __mpEventListener = NULL; + __mIsInit = false; } @@ -324,9 +325,8 @@ void CAudioSessionHandler::__sound_pcm_focus_cb(int id, mm_sound_focus_type_e fo pHandler->__mReasonForChange = (char *)reason_for_change; pHandler->__mAdditionalInfo = (char *)additional_info; - if (pHandler->__mpEventListener != NULL) { + if (pHandler->__mpEventListener != NULL) pHandler->__mpEventListener->onInterrupt(pHandler, id, focus_type, state, reason_for_change, additional_info); - } return; }