[Webkit-unassigned] [Bug 146242] WinLauncher fails to download files.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 24 04:05:47 PDT 2015


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

--- Comment #12 from peavo at outlook.com ---
(In reply to comment #9)
> I missed that that parameter is a IWebDownloadDelegatePtr which is a
> _com_ptr_t.  Yes, I think this is not a memory leak, but a use-after-free. 
> The IWebDownloadDelegatePtr goes out of scope, which deletes the
> WebDownloadDelegate which we are still using as a delegate.  I think you'll
> need some kind of global reference to the WebDownloadDelegate.

Thanks again for reviewing :)

I went back to constructing the download delegate object with refount 1 to keep it more in line with the rest of the code here.
To avoid the leak, I then transferred ownership to the smart pointer by calling _com_ptr_t::Attach, which does not call AddRef.
I checked that this patch does not leak the download delegate object, and there is  no use-after-free, the download delegate object is destroyed on exit.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150624/2e7f30df/attachment-0001.html>


More information about the webkit-unassigned mailing list