[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:
Digikam::DigikamImageDelegate::DigikamImageDelegate(Digikam::ImageCategorizedView*)
(digikamimagedelegate.cpp:63)
==16673==    by 0x82B4611:
Digikam::DigikamImageView::DigikamImageView(QWidget*)
(digikamimageview.cpp:81)
==16673==    by 0x82883A4:
Digikam::AlbumWidgetStack::AlbumWidgetStack(QWidget*)
(albumwidgetstack.cpp:96)
==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()
(digikamapp.cpp:229)
==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 :

http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKCategoryDrawer.html

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

http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKCategoryDrawerV3.html

I'm right or not ?

Gilles Caulier


More information about the Digikam-devel mailing list