Before calling g_source_destroy(), the aul library checks whether the source
is destroyed or not. If it's already destroyed, we do not call g_source_destroy().
Change-Id: Ied8e2462556f470e1c077b2dd6c612c142831b47
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
std::lock_guard<std::recursive_mutex> lock(self->GetRecMutex());
auto* idle_source = self->GetIdleSource();
if (idle_source != nullptr) {
- _E("[ANR] The main thread is unable to enter idle state. ");
+ _E("[ANR] The main thread is unable to enter idle state.");
_E("[ANR] Please modify the implementation so that the main loop does not "
"create a block state.");
- g_source_destroy(idle_source);
+ if (!g_source_is_destroyed(idle_source))
+ g_source_destroy(idle_source);
+
+ anr_monitor.SetIdleSource(nullptr);
}
anr_monitor.AddIdlerToDefaultContext();