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

2008-01-04 Thread Darin Adler

On Jan 4, 2008, at 1:40 AM, Simon Hausmann wrote:

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 :)


That doesn't sound right. If there was still a pointer to this from  
the QWebNetworkManager, then valgrind would not call it a leak, as I  
understand it. It's only considered "lost" if there are no pointers to  
it remaining.


-- Darin

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


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

2008-01-04 Thread Simon Hausmann
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 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


signature.asc
Description: This is a digitally signed message part.
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev