Review Request 111040: Fix possibly memory leak by not called destructor on incomplete type in kis_mask.cc

Commit Hook null at kde.org
Tue Jun 18 14:17:00 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111040/#review34563
-----------------------------------------------------------


This review has been submitted with commit 03a8a7f38cdd16ce706b3c1b1d046a77c0774673 by Friedrich W. H. Kossebau to branch master.

- Commit Hook


On June 15, 2013, 1:19 p.m., Friedrich W. H. Kossebau wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111040/
> -----------------------------------------------------------
> 
> (Updated June 15, 2013, 1:19 p.m.)
> 
> 
> Review request for Calligra, Dmitry Kazakov and Boudewijn Rempt.
> 
> 
> Description
> -------
> 
> Noone noticed this warning by the compiler?
> 
> [ 37%] Building CXX object krita/image/CMakeFiles/kritaimage.dir/kis_mask.cc.o
> /home/koder/Kode/kdegit/Calligra/calligra/krita/image/kis_mask.cc: In member function ‘void KisMask::Private::initSelectionImpl(KisSelectionSP, KisLayerSP, KisPaintDeviceSP)’:
> /home/koder/Kode/kdegit/Calligra/calligra/krita/image/kis_mask.cc:149:39: warning: possible problem detected in invocation of delete operator: [enabled by default]
> /home/koder/Kode/kdegit/Calligra/calligra/krita/image/kis_mask.cc:149:39: warning: invalid use of incomplete type ‘class KUndo2Command’ [enabled by default]
> In file included from /home/koder/Kode/kdegit/Calligra/calligra/krita/image/kis_mask.h:25:0,
>                  from /home/koder/Kode/kdegit/Calligra/calligra/krita/image/kis_mask.cc:20:
> /home/koder/Kode/kdegit/Calligra/calligra/krita/image/kis_types.h:229:7: warning: forward declaration of ‘class KUndo2Command’ [enabled by default]
> /home/koder/Kode/kdegit/Calligra/calligra/krita/image/kis_mask.cc:149:39: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
> 
> See e.g. http://en.wikibooks.org/wiki/More_C++_Idioms/Checked_delete for the background. Short, delete on objects of incomplete type is just undefined, so not an error usually, thus the compiler will not stop on it.
> 
> Attached patch fixes it by including kundo2command.h as needed to complete the type. Don't have sufficient understanding of the surrounding code, so please check if this does result in what is wanted here.
> 
> In general:
> Please watch the compiler warnings. Ideally there are NullNada????? warnings :)
> 
> 
> Diffs
> -----
> 
>   krita/image/kis_mask.cc b6388a7 
> 
> Diff: http://git.reviewboard.kde.org/r/111040/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Friedrich W. H. Kossebau
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20130618/7328b5f4/attachment.htm>


More information about the calligra-devel mailing list