Merge branch 'tizen_8.0' into tizen 86/306286/1 accepted/tizen/unified/20240221.062918 accepted/tizen/unified/toolchain/20240311.065803 accepted/tizen/unified/x/20240222.211040
authorJi-hoon Lee <dalton.lee@samsung.com>
Mon, 19 Feb 2024 12:21:04 +0000 (21:21 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Mon, 19 Feb 2024 12:21:04 +0000 (21:21 +0900)
Change-Id: I9c3fdce18b604c780e3561c4b6815627e360773d

src/service_ipc_dbus.cpp
wakeup-manager/src/wakeup_audio_manager.cpp

index 0e30c72..fa51a91 100644 (file)
@@ -1364,7 +1364,6 @@ static Eina_Bool listener_event_callback(void* data, Ecore_Fd_Handler *fd_handle
                num_messages++;
        }
 
-       print_duration(num_messages, started);
        return ECORE_CALLBACK_RENEW;
 }
 
index 0d6bb19..991a054 100644 (file)
@@ -340,9 +340,19 @@ void CAudioManager::streaming_audio_data_thread_func(long long start_time)
 
                lock.lock();
                end = mAudioData.end();
+
+               /* Check if the lead variable is still valid, just in case the mAudioData variable
+                * got cleared by another thread before the lock gets acquired again. */
+               bool is_lead_valid = false;
+               for (auto it = mAudioData.begin();is_lead_valid == false && it != end;++it) {
+                       if (lead == it) {
+                               is_lead_valid = true;
+                       }
+               }
+
                vector<IAudioEventObserver*> observers = mObservers;
 
-               if (lead != end) {
+               if (is_lead_valid && lead != end) {
                        iter = lead;
 
                        mas_speech_data speech_data = iter->data;