Removing all event_handler from events while closing application.
Without removing event_handler it is possible that native api will call
event with destroyed data. This fix is to prevent such situation
[Verification] Code compiles without error. TCT passrate 100%
Change-Id: I94d1fbb85ad47ca6dbcba6c56cd043521952860e
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
StopAppInfoEventListener();
StopStatusChangeListener();
+ for (auto it = event_handler_map_.begin(); it != event_handler_map_.end();) {
+ int ret = event_remove_event_handler(it->second);
+ if (EVENT_ERROR_NONE != ret) {
+ LoggerE("event_remove_event_handler failed, error: %d (%s)", ret, get_error_message(ret));
+ }
+ it = event_handler_map_.erase(it);
+ }
+
if (app_status_handle_) {
int ret = app_manager_event_destroy(app_status_handle_);
if (APP_MANAGER_ERROR_NONE != ret) {