Bug 4674

Summary: LEAK: WheelEventImpl leaked when mousewheel used
Product: WebKit Reporter: Kurt Kohler <kohler>
Component: New BugsAssignee: Geoffrey Garen <ggaren>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch to add ref/deref
ggaren: review-
refptr patch eric: review+

Description Kurt Kohler 2005-08-26 16:52:22 PDT
A WheelEventImpl is leaked in NodeImpl::dispatchWheelEvent when a mouse wheel
event is being handled. The problem appears to be missing ref/deref's around the
call to dispatchEvent. I have a patch.
Comment 1 Kurt Kohler 2005-08-26 16:54:28 PDT
Created attachment 3590 [details]
Patch to add ref/deref

This patch makes the code consistent with other event dispatchers, it *may* be
correct.
Comment 2 Kurt Kohler 2005-08-26 17:10:42 PDT
I forgot to include the call stack that started the whole thing.

Leak: 0x0bde14d0  size=112
        0x019a4fa8 0x00000000 0x00000000 0x00000001     ..O.............
        0x00000001 0x00000000 0x00000000 0x00000000     ................
        0x00000000 0x0000003a 0x00000000 0x000000ae     .......:........
        0x00000000 0x41a17f6c 0xddc367a1 0x0a443030     ....A..l..g..D00
        0x00000000 0x000003ed 0x00000259 0x00000176     ...........Y...v
        0x00000230 0x00000371 0x00000230 0x00000371     ...0...q...0...q
        0x00000001 0x000000c0 0x000014cc 0x00000007     ................
        Call stack: [thread 26df]: |
        0x0 |
        0x57190 |
        0x26e0 |
        NSApplicationMain |
        -[NSApplication run] |
        0x1a684 |
        -[NSApplication sendEvent:] |
        0x1d69c |
        -[NSWindow sendEvent:] |
        -[WebHTMLView scrollWheel:] |
        -[WebCoreBridge sendScrollWheelEvent:] |
        KWQKHTMLPart::wheelEvent(NSEvent*) |
        KHTMLView::viewportWheelEvent(QWheelEvent*) |
        DOM::NodeImpl::dispatchWheelEvent(QWheelEvent*) |
        DOM::EventImpl::operator new(unsigned long) |
        khtml::main_thread_malloc(unsigned long) |
        malloc 
Comment 3 Oliver Hunt 2005-09-07 04:08:35 PDT
Do you have a testcase/site that triggers the leak?
Comment 4 Michael J. Cohen 2006-01-10 08:47:01 PST
simpy scrolling up and down seems to reproduce this for me.
Comment 5 Joost de Valk (AlthA) 2006-02-13 15:55:47 PST
Reassigning to webkit-unassigned, to make sure more people see this.
Comment 6 Joost de Valk (AlthA) 2006-02-15 14:41:57 PST
Comment on attachment 3590 [details]
Patch to add ref/deref

Though this is an old patch this might yet be valid.
Comment 7 Joost de Valk (AlthA) 2006-02-15 14:42:23 PST
Confirming.
Comment 8 Geoffrey Garen 2006-02-15 15:32:08 PST
Comment on attachment 3590 [details]
Patch to add ref/deref

Should use a refptr. I'll submit a patch shortly.
Comment 9 Geoffrey Garen 2006-02-15 15:33:58 PST
Created attachment 6514 [details]
refptr patch
Comment 10 Eric Seidel (no email) 2006-02-15 15:38:16 PST
Comment on attachment 6514 [details]
refptr patch

r=me.
Comment 11 Geoffrey Garen 2006-02-15 16:16:49 PST
Landed.