[webkit-dev] Re: QWebNetworkManager triggering a memleak in Qt

Simon Hausmann hausmann at kde.org
Fri Jan 4 01:40:58 PST 2008


On Thursday 03 January 2008 23:28:49 Adam Treat wrote:
> Hi,
>
> I've checked and this appears to be the case in both Qt 4.3.2 and Qt 4.4
> snapshot...
>
> ==7746== 4 bytes in 1 blocks are definitely lost in loss record 5 of 507
> ==7746==    at 0x4022765: malloc (vg_replace_malloc.c:149)
> ==7746==    by 0x5CB16C4: qMalloc(unsigned) (qglobal.cpp:1964)
> ==7746==    by 0x5D7E43C: queuedConnectionTypes(QList<QByteArray> const&)
> (qobject.cpp:67)
> ==7746==    by 0x5D82E5A: QObject::connect(QObject const*, char const*,
> QObject const*, char const*, Qt::ConnectionType) (qobject.cpp:2567)
> ==7746==    by 0x80513D2: QObject::connect(QObject const*, char const*,
> char const*, Qt::ConnectionType) const (qobject.h:291)
> ==7746==    by 0x4B38C6C: QWebNetworkManager::QWebNetworkManager()
> (qwebnetworkinterface.cpp:432)
> ==7746==    by 0x4B38D5F:
> QWebNetworkInterface::QWebNetworkInterface(QObject*)
> (qwebnetworkinterface.cpp:906)
> ==7746==    by 0x4B38DE6: QWebNetworkInterface::defaultInterface()
> (qwebnetworkinterface.cpp:890)
> ==7746==    by 0x4B38E36: QWebNetworkManager::self()
> (qwebnetworkinterface.cpp:438)
> ==7746==    by 0x4AFAFD7: WebCore::ResourceHandle::start(WebCore::Frame*)
> (ResourceHandleQt.cpp:134)
> ==7746==    by 0x49E9280:
> WebCore::ResourceHandle::create(WebCore::ResourceRequest const&,
> WebCore::ResourceHandleClient*, WebCore::Frame*, bool, bool, bool)
> (ResourceHandle.cpp:53)
> ==7746==    by 0x4970831:
> WebCore::MainResourceLoader::loadNow(WebCore::ResourceRequest&)
> (MainResourceLoader.cpp:377)
>
> QObject is allocating memory for this queued connection that is apparently
> never freed.

I don't believe that is a bug in Qt, I believe this leak is due to the fact 
that the QWebNetworkManager instance (s_manager) is never deleted, and as a 
result the connection is never broken up, so valgrind correctly claims a 
leak :)


Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.webkit.org/pipermail/webkit-dev/attachments/20080104/31e7626c/attachment.bin


More information about the webkit-dev mailing list