[Webkit-unassigned] [Bug 127474] [GTK] Loading page into WebView shows g_closure_unref warning

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 13 10:42:06 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=127474

--- Comment #7 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 246524
  --> https://bugs.webkit.org/attachment.cgi?id=246524
proposed patch

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

Do we have a simple test case or any other way to reproduce this? If we could add at least a unit test it would be perfect.

> Source/WebCore/bindings/gobject/GObjectEventListener.cpp:58
> +    // Add one reference in case the 'target' holds the last reference,
> +    // which may cause, inside removeEventListener(), free of this object
> +    // and later use-after-free with the m_handler = 0; assignment.
> +    ref();

As Anders suggests, you could do something like RefPtr<GObjectEventListener> protect(this); instead of calling ref/deref.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150213/052952aa/attachment-0002.html>


More information about the webkit-unassigned mailing list