[HOTFIX] Fix crash on closing application from task manager 94/190694/1 accepted/tizen/unified/20181005.012526 accepted/tizen/unified/20181005.092601 submit/tizen/20181004.232740 submit/tizen/20181005.092158
authorsurya.kumar7 <surya.kumar7@samsung.com>
Thu, 4 Oct 2018 18:35:46 +0000 (00:05 +0530)
committersurya.kumar7 <surya.kumar7@samsung.com>
Thu, 4 Oct 2018 18:36:07 +0000 (00:06 +0530)
Change-Id: I830713b5fe14523ee967531b560857677abd8d89
Signed-off-by: surya.kumar7 <surya.kumar7@samsung.com>
runtime/browser/ui_runtime.cc
runtime/browser/web_application.cc
runtime/browser/web_application.h

index 45a465a143e29ffbc7c8740f003fd0fd5de95eb0..e549c0235e1152ede00b02adfdfe8467e0e8353a 100755 (executable)
@@ -156,6 +156,8 @@ bool UiRuntime::OnCreate() {
 }
 
 void UiRuntime::OnTerminate() {
+  if (application_)
+    application_->SimulateBackKeyClosing();
 }
 
 void UiRuntime::Terminate() {
index 43be4fb11123690365e6b0ca7510789f9c049ead..38bb911032c0c2a69e122b13f18eb60587072427 100755 (executable)
@@ -1047,6 +1047,12 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) {
   }
 }
 
+void WebApplication::SimulateBackKeyClosing() {
+  window_->InActive();
+  while (view_stack_.size())
+    OnHardwareKey(view_stack_.front(), kKeyNameBack);
+}
+
 void WebApplication::OnLanguageChanged() {
   lang_changed_mode_ = true;
   locale_manager_->UpdateSystemLocale();
index 5b247b22baf3fc7c0da03d0b965d08550426d657..a54208b75b3b0f4bcb6ea9ac4db2c0ed87005c17 100755 (executable)
@@ -116,6 +116,7 @@ class WebApplication : public WebView::EventListener {
     WebApplication* application;
     Ecore_Timer* timer;
   } main_loop, session_counter;
+  void SimulateBackKeyClosing();
 
  private:
   bool Initialize();