Don't destroy the window in PlatformWindow's destructor.
commit133ead2f6c4ecf2efb8905fb4cbfaada614847fc
authorjam <jam@chromium.org>
Mon, 18 May 2015 20:00:23 +0000 (18 13:00 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 18 May 2015 20:01:29 +0000 (18 20:01 +0000)
tree465b5dbf7b9c51fac19239c9bce8873a8ba88695
parentcd24f7e8d5d05cae491599aea8bab20da4e7e6ac
Don't destroy the window in PlatformWindow's destructor.

This should have already been closed before we get to the destructor. Otherwise we get double deletes since the Destroy() call can end up calling the delegate which will delete this object.

Also in the X11 implementation, don't call delegate's OnClosed() before null'ing xwindow_, otherwise Destroy() can be called multiple times.

This is split off https://codereview.chromium.org/1139673003

BUG=484234

Review URL: https://codereview.chromium.org/1132313003

Cr-Commit-Position: refs/heads/master@{#330381}
ui/platform_window/win/win_window.cc
ui/platform_window/x11/x11_window.cc