Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: ui/platform_window/x11/x11_window.cc

Issue 1139673003: Make Mandoline shut down cleanly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/platform_window/win/win_window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/platform_window/x11/x11_window.cc
diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc
index 14e6fdf0b282421af5e88e7bf8c6c27032543337..57d3a5e20c47fb0f89adc9a95e261256ceb0aa66 100644
--- a/ui/platform_window/x11/x11_window.cc
+++ b/ui/platform_window/x11/x11_window.cc
@@ -52,18 +52,21 @@ X11Window::X11Window(PlatformWindowDelegate* delegate)
}
X11Window::~X11Window() {
- Destroy();
}
void X11Window::Destroy() {
- delegate_->OnClosed();
if (xwindow_ == None)
return;
// Stop processing events.
PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
- XDestroyWindow(xdisplay_, xwindow_);
+ XID xwindow = xwindow_;
+ XDisplay* xdisplay = xdisplay_;
xwindow_ = None;
+ delegate_->OnClosed();
+ // |this| might be deleted because of the above call.
+
+ XDestroyWindow(xdisplay, xwindow);
}
void X11Window::ProcessXInput2Event(XEvent* xev) {
« no previous file with comments | « ui/platform_window/win/win_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698