[Digikam-devel] KCategoryDrawer and memory leak...

Gilles Caulier caulier.gilles at gmail.com
Wed Nov 3 12:14:07 CET 2010

Hi all,

Valgrind crying again on my computer with this trace :

==16673== 3,152 (12 direct, 3,140 indirect) bytes in 1 blocks are
definitely lost in loss record 6,503 of 6,663
==16673==    at 0x40244F0: operator new(unsigned int) (vg_replace_malloc.c:214)
==16673==    by 0x82B6F71:
==16673==    by 0x82B4611:
==16673==    by 0x82883A4:
==16673==    by 0x82BADA1: Digikam::DigikamView::DigikamView(QWidget*,
Digikam::DigikamModelCollection*) (digikamview.cpp:168)
==16673==    by 0x829AD32: Digikam::DigikamApp::setupView() (digikamapp.cpp:490)
==16673==    by 0x82998A0: Digikam::DigikamApp::DigikamApp()
==16673==    by 0x83863D1: main (main.cpp:172)

If i look in code, i can see that memory leak is relevant of this call

    d->categoryDrawer = new ImageCategoryDrawer(parent);

ImageCategoryDrawer is based on KCategoryDrawer. on KDE4 api doc we
can see that KCategoryDrawer is not based on QObject :


... and instance is not delete in destructor. Also, KCategoryDrawer is
deprecated. KCategoryDrawerV3 must be used instead.


I'm right or not ?

Gilles Caulier

More information about the Digikam-devel mailing list