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

Issue 10826117: Fix memory leak in ~GestureRecognizerImpl (Closed)

Created:
8 years, 4 months ago by girard
Modified:
8 years, 4 months ago
Reviewers:
sadrul, sky
CC:
chromium-reviews
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

~GestureRecognizerImpl() was leaking memory. Now it doesn't. An unfortunate side effect of this leak was that GestureSequence objects hold a pointer to the GR's parent window (helper_) that is no longer valid after the dtor is called. They also hold a callback timer, which fires for a long press... This CL fixes the crash in issue 139420, but it doesn't fix the full bug. Specifically, the popup menu is still not responding to touch. BUG=139420 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149957

Patch Set 1 #

Total comments: 4

Patch Set 2 : Also refactored event_queue. #

Patch Set 3 : Also refactored TouchEventQueue. #

Patch Set 4 : Simplified the CL to call dtor during dtor. #

Total comments: 3

Patch Set 5 : Revised as per sky's review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -0 lines) Patch
M ui/base/gestures/gesture_recognizer_impl.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
girard
Replaced raw pointer with scoped_ptr. Ensures that objects will be cleaned up in a timely ...
8 years, 4 months ago (2012-08-02 17:14:20 UTC) #1
sadrul
http://codereview.chromium.org/10826117/diff/1/ui/base/gestures/gesture_recognizer_impl.cc File ui/base/gestures/gesture_recognizer_impl.cc (right): http://codereview.chromium.org/10826117/diff/1/ui/base/gestures/gesture_recognizer_impl.cc#newcode345 ui/base/gestures/gesture_recognizer_impl.cc:345: event_queue_.erase(consumer); Perhaps we need to do the same for ...
8 years, 4 months ago (2012-08-02 18:29:55 UTC) #2
girard
Refactored previous CL to deal with more raw pointers. scoped_ptr's FTW. http://codereview.chromium.org/10826117/diff/1/ui/base/gestures/gesture_recognizer_impl.cc File ui/base/gestures/gesture_recognizer_impl.cc (right): ...
8 years, 4 months ago (2012-08-02 19:33:53 UTC) #3
sadrul
The patch doesn't seem to compile on linux-chromeos. Would you please update the patch with ...
8 years, 4 months ago (2012-08-02 21:01:12 UTC) #4
girard
On 2012/08/02 21:01:12, sadrul wrote: > The patch doesn't seem to compile on linux-chromeos. Would ...
8 years, 4 months ago (2012-08-03 14:55:34 UTC) #5
girard
This CL is much simpler.... we now add clean-up logic into ~GestureRecognizerImpl().
8 years, 4 months ago (2012-08-03 18:41:51 UTC) #6
sadrul
I think this looks good. +sky in case there is a better way of doing ...
8 years, 4 months ago (2012-08-03 19:58:52 UTC) #7
sky
http://codereview.chromium.org/10826117/diff/8002/ui/base/gestures/gesture_recognizer_impl.cc File ui/base/gestures/gesture_recognizer_impl.cc (right): http://codereview.chromium.org/10826117/diff/8002/ui/base/gestures/gesture_recognizer_impl.cc#newcode174 ui/base/gestures/gesture_recognizer_impl.cc:174: for (i = consumer_sequence_.begin(); i != consumer_sequence_.end(); ++i) Move ...
8 years, 4 months ago (2012-08-03 20:05:06 UTC) #8
girard
Updated as per sky's review. Much cleaner, and shorter. http://codereview.chromium.org/10826117/diff/8002/ui/base/gestures/gesture_recognizer_impl.cc File ui/base/gestures/gesture_recognizer_impl.cc (right): http://codereview.chromium.org/10826117/diff/8002/ui/base/gestures/gesture_recognizer_impl.cc#newcode174 ui/base/gestures/gesture_recognizer_impl.cc:174: ...
8 years, 4 months ago (2012-08-03 20:14:45 UTC) #9
sadrul
LGTM http://codereview.chromium.org/10826117/diff/8002/ui/base/gestures/gesture_recognizer_impl.cc File ui/base/gestures/gesture_recognizer_impl.cc (right): http://codereview.chromium.org/10826117/diff/8002/ui/base/gestures/gesture_recognizer_impl.cc#newcode174 ui/base/gestures/gesture_recognizer_impl.cc:174: for (i = consumer_sequence_.begin(); i != consumer_sequence_.end(); ++i) ...
8 years, 4 months ago (2012-08-03 20:16:42 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/girard@chromium.org/10826117/7
8 years, 4 months ago (2012-08-03 20:28:54 UTC) #11
commit-bot: I haz the power
8 years, 4 months ago (2012-08-03 23:02:01 UTC) #12
Change committed as 149957

Powered by Google App Engine
This is Rietveld 408576698