Bug 119003

Summary: [GTK] GtkAdjustmentWatcher idle source not correctly handled
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: gdesmott, grant_gayed, pochu27
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Updated patch mrobinson: review+

Description Carlos Garcia Campos 2013-07-23 01:52:17 PDT
GtkAdjustmentWatcher::updateAdjustmentsFromScrollbarsLater() creates a new idle source and initializes m_updateAdjustmentCallbackId, which is used everywhere and specially in the destructor to cancel the source when the GtkAdjustmentWatcher is deleted. However, m_updateAdjustmentCallbackId is reset to 0 in GtkAdjustmentWatcher::updateAdjustmentsFromScrollbars() only when not returning early. This method is public and not only called by the updateAdjustmentCallback, which means that a call to updateAdjustmentsFromScrollbars could reset the m_updateAdjustmentCallbackId without actually destroying the source.
Comment 1 Carlos Garcia Campos 2013-07-23 01:55:42 PDT
Created attachment 207312 [details]
Patch

Only reset the idle id when the idle callback has been called.
Comment 2 Carlos Garcia Campos 2013-07-23 02:05:27 PDT
I wonder if should also destroy the source in GtkAdjustmentWatcher::updateAdjustmentsFromScrollbars() where we were setting it to 0 before, since we have already handled the adjustment update.
Comment 3 Carlos Garcia Campos 2013-07-23 03:04:15 PDT
Created attachment 207317 [details]
Updated patch

Also destroy the source in GtkAdjustmentWatcher::updateAdjustmentsFromScrollbars()
Comment 4 Carlos Garcia Campos 2013-07-23 08:07:04 PDT
*** Bug 118396 has been marked as a duplicate of this bug. ***
Comment 5 Martin Robinson 2013-07-23 08:13:13 PDT
Comment on attachment 207317 [details]
Updated patch

Thanks!
Comment 6 Carlos Garcia Campos 2013-07-23 08:34:59 PDT
Committed r153052: <http://trac.webkit.org/changeset/153052>