From: Artur Świgoń Date: Tue, 6 Jul 2021 15:12:28 +0000 (+0200) Subject: [SVACE] Fixes use of v variable after it was freed by eldbus_service_interface_unregi... X-Git-Tag: accepted/tizen/6.0/unified/20211029.040244^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_7.0_unified;p=profile%2Fmobile%2Fapps%2Fnative%2Faccessibility-setting.git [SVACE] Fixes use of v variable after it was freed by eldbus_service_interface_unregister() Change-Id: I1e1d68d6dd2fd3c2dffd74f52c2648495633149a --- diff --git a/src/service/DBus.cpp b/src/service/DBus.cpp index 0720693..b75782e 100644 --- a/src/service/DBus.cpp +++ b/src/service/DBus.cpp @@ -677,9 +677,11 @@ struct DefaultDBusWrapper : public DBusWrapper DBUS_DEBUG("registering interface %p (%d)", v, fallback ? 1 : 0); destructors.push_back([=]() { DBUS_DEBUG("unregistering interface %p", v); + { + std::lock_guard lock(globalEntriesMutex); + globalEntries.erase(v); + } eldbus_service_interface_unregister(v); - std::lock_guard lock(globalEntriesMutex); - globalEntries.erase(v); }); } }