| 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..ed6d353665e3761d3b992229a2b2dafc770c3cc9 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) {
|
|
|