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

Unified Diff: ui/base/gestures/gesture_recognizer_impl.cc

Issue 10826117: Fix memory leak in ~GestureRecognizerImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Simplified the CL to call dtor during dtor. Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/gestures/gesture_recognizer_impl.cc
diff --git a/ui/base/gestures/gesture_recognizer_impl.cc b/ui/base/gestures/gesture_recognizer_impl.cc
index 20b88d4a437d7344bf02e38dda8e1e79847132f5..94c3e859104ec176392c2ef5bb565b0f95aa4f13 100644
--- a/ui/base/gestures/gesture_recognizer_impl.cc
+++ b/ui/base/gestures/gesture_recognizer_impl.cc
@@ -170,6 +170,12 @@ GestureRecognizerImpl::GestureRecognizerImpl(GestureEventHelper* helper)
}
GestureRecognizerImpl::~GestureRecognizerImpl() {
+ std::map<GestureConsumer*, GestureSequence*>::iterator i;
+ for (i = consumer_sequence_.begin(); i != consumer_sequence_.end(); ++i)
sky 2012/08/03 20:05:07 Move iterators inside the for loop, that way you d
girard 2012/08/03 20:14:45 Nice! I was hoping there might be a utility to ta
sadrul 2012/08/03 20:16:42 Nice! Thanks!
+ delete i->second;
+ std::map<GestureConsumer*, TouchEventQueue*>::iterator i2;
+ for (i2 = event_queue_.begin(); i2 != event_queue_.end(); ++i2)
+ delete i2->second;
}
// Checks if this finger is already down, if so, returns the current target.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698