Bug 57611 - [GTK] Do not destroy WorkQueue event sources unless they have been cancelled
Summary: [GTK] Do not destroy WorkQueue event sources unless they have been cancelled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 57540
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-01 03:20 PDT by Carlos Garcia Campos
Modified: 2011-04-08 03:36 PDT (History)
0 users

See Also:


Attachments
Patch (8.70 KB, patch)
2011-04-01 03:29 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2011-04-01 03:20:19 PDT
We are currently returning FALSE from performWork() when condition contains HUP or ERR which makes the source to be destroyed, but it's not removed from the event source list. When unregisterEventSourceHandler() is called the source might be destroyed already. To avoid that we can simply return TRUE from the callback unless it has been cancelled (condition = 0) which happens in unregisterEventSourceHandler().
Comment 1 Carlos Garcia Campos 2011-04-01 03:29:23 PDT
Created attachment 87836 [details]
Patch

This patch applies on top of patch attached to bug #57540
Comment 2 Martin Robinson 2011-04-01 09:43:30 PDT
Comment on attachment 87836 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=87836&action=review

Nice.

> Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:61
>              if (!queue->m_isValid)
> -                return FALSE;
> +                return;

It appears that Mac does not cancel the source either if the queue is invalid. Do you know in what cases this can happen?
Comment 3 Carlos Garcia Campos 2011-04-08 03:35:51 PDT
Committed r83281: <http://trac.webkit.org/changeset/83281>