Index: ui/aura/root_window_host_linux.cc |
=================================================================== |
--- ui/aura/root_window_host_linux.cc (revision 124478) |
+++ ui/aura/root_window_host_linux.cc (working copy) |
@@ -305,6 +305,8 @@ |
if (base::MessagePumpForUI::HasXInput2()) |
ui::TouchFactory::GetInstance()->SetupXI2ForXWindow(xwindow_); |
+ MessageLoopForUI::current()->AddDestructionObserver(this); |
+ |
// Initialize invisible cursor. |
char nodata[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; |
XColor black; |
@@ -326,6 +328,8 @@ |
ui::GetXCursor(ui::kCursorClearXCursorCache); |
XFreeCursor(xdisplay_, invisible_cursor_); |
+ |
+ MessageLoopForUI::current()->RemoveDestructionObserver(this); |
} |
base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch( |
@@ -620,6 +624,10 @@ |
XSendEvent(xdisplay_, xwindow_, False, 0, &xevent); |
} |
+void RootWindowHostLinux::WillDestroyCurrentMessageLoop() { |
+ aura::RootWindow::DeleteInstance(); |
+} |
+ |
bool RootWindowHostLinux::IsWindowManagerPresent() { |
// Per ICCCM 2.8, "Manager Selections", window managers should take ownership |
// of WM_Sn selections (where n is a screen number). |