summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 03:42:03 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 03:42:03 +0000
commitc16c02f0b5ae36eba204137329494820620488e3 (patch)
tree0379423c8540dd06cb53ba209908f639e40fe05d /ash
parent308ab300ba8c4262401886bdbc67e10e098f07fe (diff)
downloadchromium_src-c16c02f0b5ae36eba204137329494820620488e3.zip
chromium_src-c16c02f0b5ae36eba204137329494820620488e3.tar.gz
chromium_src-c16c02f0b5ae36eba204137329494820620488e3.tar.bz2
ash: Fix a crash from pinch-to-minimize.
BUG=121140 TEST=manually Review URL: https://chromiumcodereview.appspot.com/10511022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/wm/system_gesture_event_filter.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc
index 80f59e3..0023d6c 100644
--- a/ash/wm/system_gesture_event_filter.cc
+++ b/ash/wm/system_gesture_event_filter.cc
@@ -78,6 +78,9 @@ class SystemPinchHandler {
wm::MaximizeWindow(target_);
} else if (phantom_state_ == PHANTOM_WINDOW_MINIMIZED) {
wm::MinimizeWindow(target_);
+ // NOTE: Minimizing the window will cause this handler to be
+ // destroyed. So do not access anything from |this| from here.
+ return SYSTEM_GESTURE_END;
} else {
gfx::Rect bounds = phantom_.IsShowing() ? phantom_.bounds() :
target_->bounds();
@@ -360,7 +363,10 @@ void SystemGestureEventFilter::OnWindowDestroying(aura::Window* window) {
void SystemGestureEventFilter::ClearGestureHandlerForWindow(
aura::Window* window) {
WindowPinchHandlerMap::iterator find = pinch_handlers_.find(window);
- DCHECK(find != pinch_handlers_.end());
+ if (find == pinch_handlers_.end()) {
+ // The handler may have already been removed.
+ return;
+ }
delete (*find).second;
pinch_handlers_.erase(find);
window->RemoveObserver(this);