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

Commit Hook null at kde.org
Thu Jun 20 10:08:34 BST 2013


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


This review has been submitted with commit 790d762da8656ea8edd0ebf5bf6afcbc5b77dcbd by Boudewijn Rempt on behalf of Friedrich W. H. Kossebau to branch calligra/2.7.

- Commit Hook


On June 18, 2013, 1:17 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 18, 2013, 1:17 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/20130620/da3ef855/attachment.htm>


More information about the calligra-devel mailing list