Memory leak in KIconLoader

Michael Jansen kde at michael-jansen.biz
Sat May 10 22:02:47 BST 2008


Hi

Valgrind complains 

==29366== 411,764 (32 direct, 411,732 indirect) bytes in 4 blocks are 
definitely lost in loss record 116 of 334
==29366==    at 0x4C22515: operator new(unsigned long) (in 
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==29366==    by 0xA44E896: KIconLoaderPrivate::addAppThemes(QString const&) 
(kiconloader.cpp:527)
==29366==    by 0xA44EAD0: KIconLoader::addAppDir(QString const&) 
(kiconloader.cpp:515)
==29366==    by 0x6C2868E: KMail::insertLibraryCataloguesAndIcons() 
(kmstartup.cpp:253)
==29366==    by 0x403414: main (main.cpp:108)


kiconloader.cpp:529
     KIconThemeNode* node = new KIconThemeNode(def);

    if (!mThemesInTree.contains(node->theme->internalName())) {
        mThemesInTree.append(node->theme->internalName());
        links.append(node);
    }
    addBaseThemes(node, appname);

That code was introduced with change 794709. The nodes will be delete with a 
qDeleteAll(links) so some nodes are leaked. I'm not sure how to fix it so i 
put it here.


-- 
Michael Jansen
Available for contract work ( Development / Configuration Management )
http://www.michael-jansen.biz




More information about the kde-core-devel mailing list