[Webkit-unassigned] [Bug 72558] New: [Qt] load(),

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 16 15:57:36 PST 2011


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

           Summary: [Qt] load(),
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit2
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: romaxa at gmail.com


QtWebPageProxy::load, QtWebPageProxy::url, QtWebPageProxy::title, and some other API functions leaking strings.

==4060== 98 (36 direct, 62 indirect) bytes in 1 blocks are definitely lost in loss record 2,932 of 3,759
==4060==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==4060==    by 0x5702890: WTF::fastMalloc(unsigned int) (FastMalloc.cpp:268)
==4060==    by 0x472C622: WTF::RefCounted<WebKit::APIObject>::operator new(unsigned int) (RefCounted.h:178)
==4060==    by 0x472E803: WebKit::WebURL::create(WTF::String const&) (WebURL.h:46)
==4060==    by 0x472E916: WebKit::toCopiedURLAPI(WTF::String const&) (WKSharedAPICast.h:162)
==4060==    by 0x4784CB2: WKURLCreateWithQUrl(QUrl const&) (WKURLQt.cpp:34)
==4060==    by 0x484BB7D: QtWebPageProxy::load(QUrl const&) (QtWebPageProxy.cpp:718)
==4060==    by 0x4788D3C: QQuickWebView::load(QUrl const&) (qquickwebview.cpp:390)

WKRetainPtr<WKURLRef> wkurl(WKURLCreateWithQUrl(url));
WKPageLoadURL(pageRef(), wkurl.get());


WebURL created by WKURLCreateWithQUrl, getting refcount + 1 in '
WKURLRef toCopiedURLAPI
RefPtr<WebURL> webURL = WebURL::create(string);
return toAPI(webURL.release().leakRef());

but it never released after WKRetainPtr<WKURLRef> wkurl destroyed...
Not sure what is right way to fix it... I guess on WKRetainPtr<WKURLRef> wkurl destroy it should destroy adopted toImpl WebURL pointer..

Quick workaround to fix this problem is to add:
PassRefPtr<WebURL/WebString> autoDeletePtr = adoptRef(toImpl(wkrefPtr));
which will destroy WebURL/WebString instance on exit from the function...

Otherwise I need to go deeply into smart-pointers relation ship and figure out how to make it works automatically...


Any ideas?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list