From: ws29.jung Date: Mon, 9 Jan 2017 12:23:32 +0000 (+0900) Subject: Prevent duplicated eventcallback call X-Git-Tag: submit/tizen_3.0/20170109.135200^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88e577caa2f01c84b3ff6f7a5643aaeb7b3a3435;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Prevent duplicated eventcallback call Unexpectly, there is some case which calls same function twice. To prevent these case, it is proper to set eventlistener to NULL when webview is pop/erased from view stack. Bug: http://suprem.sec.samsung.net/jira/browse/TSAM-12508 Change-Id: Ie1931bc9d20e3db0c3dde04f640b82e8b3fa17dc Signed-off-by: ws29.jung --- diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 31613dd8d..9a5d50b39 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -675,19 +675,23 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) { WebView* current = view_stack_.front(); if (current == view) { + // In order to prevent the crash issue due to the callback + // which occur after destroying WebApplication class, + // we have to set the 'SetEventListener' to NULL. + view->SetEventListener(NULL); view_stack_.pop_front(); } else { auto found = std::find(view_stack_.begin(), view_stack_.end(), view); if (found != view_stack_.end()) { + // In order to prevent the crash issue due to the callback + // which occur after destroying WebApplication class, + // we have to set the 'SetEventListener' to NULL. + view->SetEventListener(NULL); view_stack_.erase(found); } } if (view_stack_.size() == 0) { - // In order to prevent the crash issue due to the callback - // which occur after destroying WebApplication class, - // we have to set the 'SetEventListener' to NULL. - view->SetEventListener(NULL); Terminate(); } else if (current != view_stack_.front()) { view_stack_.front()->SetVisibility(true);