- update source.
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / ui / native_app_window_tizen.cc
index 15e26f0..5a9d39f 100644 (file)
@@ -22,7 +22,7 @@ NativeAppWindowTizen::NativeAppWindowTizen(
     : NativeAppWindowViews(create_params),
       indicator_widget_(new TizenSystemIndicatorWidget()),
       allowed_orientations_(ANY) {
-  indicator_container_.reset(new WidgetContainerView(indicator_widget_.get()));
+  indicator_container_.reset(new WidgetContainerView(indicator_widget_));
 }
 
 void NativeAppWindowTizen::Initialize() {
@@ -52,9 +52,6 @@ void NativeAppWindowTizen::Initialize() {
 NativeAppWindowTizen::~NativeAppWindowTizen() {
   if (SensorProvider::GetInstance())
     SensorProvider::GetInstance()->RemoveObserver(this);
-  aura::Window* root_window = GetNativeWindow()->GetRootWindow();
-  DCHECK(root_window);
-  root_window->RemoveObserver(this);
 }
 
 void NativeAppWindowTizen::ViewHierarchyChanged(
@@ -81,6 +78,12 @@ void NativeAppWindowTizen::OnWindowBoundsChanged(
   GetWidget()->GetRootView()->SetSize(new_bounds.size());
 }
 
+void NativeAppWindowTizen::OnWindowDestroying(aura::Window* window) {
+  // Must be removed here and not in the destructor, as the aura::Window is
+  // already destroyed when our destructor runs.
+  window->RemoveObserver(this);
+}
+
 void NativeAppWindowTizen::OnWindowVisibilityChanging(
     aura::Window* window, bool visible) {
   if (visible)