Review Request: static_casts for dom

Albert Astals Cid aacid at kde.org
Thu Oct 29 18:58:32 GMT 2009


A Dijous, 29 d'octubre de 2009, Jaime va escriure:
> Hi,
> 
>   I've only detected 2 C style cast in klipper code from last sunday
> at lines 359 and 371 of urlgrabber.cpp (both reinterpret_cast).
> Sorry, no svn access at the moment.
> What the tool (cppcheck) has detected are possible memory leaks
> (actually at a <10% successful rate in .cpp files and >90% successful
> rate in .h files):
> 
> [./configdialog.cpp:196]: (style) The scope of the variable commandIdx
> can be limited
> [./configdialog.cpp:132]: (possible error) Memory leak: child  (
> Probably not, because it does not fully understand yet the Qt
> cascading destructors )
> [./configdialog.cpp:364]: (possible error) Memory leak: mainLayout  (
> Problably not )
> [./configdialog.h:75]: (possible error) Memory leak:
> ActionsWidget::m_editActDlg    ( I do not see the delete in the
> destructor )
> [./configdialog.h:98]: (possible error) Memory leak:
> AdvancedWidget::editListBox    ( I do not see the delete in the
> destructor )
> [./configdialog.h:118]: (possible error) Memory leak:
> ConfigDialog::m_actionsPage  ( I do not see the delete in the
> destructor )
> [./configdialog.h:119]: (possible error) Memory leak:
> ConfigDialog::m_shortcutsWidget  ( I do not see the delete in the
> destructor )
> [./editactiondialog.h:71]: (possible error) Memory leak:
> EditActionDialog::m_model   ( I do not see the delete in the
> destructor )
> [./klipper.cpp:468]: (style) The scope of the variable dataList can be
>  limited [./klipper.h:179]: (possible error) Memory leak:
>  Klipper::m_history ( I do not see the delete in the destructor )
>  [./klipper.h:181]: (possible error) Memory leak:
> Klipper::m_toggleURLGrabAction     ( I do not see the delete in the
> destructor )
> [./klipper.h:223]: (possible error) Memory leak: Klipper::m_collection
>                       ( I do not see the delete in the destructor )
> [./klipperpopup.h:96]: (possible error) Memory leak:
> KlipperPopup::m_helpmenu         ( empty destructor )
> [./klipperpopup.h:106]: (possible error) Memory leak:
>  KlipperPopup::m_popupProxy [./klipperpopup.h:111]: (possible error) Memory
>  leak:
> KlipperPopup::m_filterWidget
> [./klipperpopup.h:116]: (possible error) Memory leak:
> KlipperPopup::m_filterWidgetAction
> [./tray.h:38]: (possible error) Memory leak: KlipperTray::m_klipper
>                      ( no explicit destructor )
> [./urlgrabber.cpp:157]: (possible error) Memory leak: action
> ( Probably not )

Seems like this tool doesn't have knowledge of QObject children auto 
destruction making it a bit useless detecting memory leaks.

Albert

> 
> Best Regards.
> 
> 2009/10/29 Esben Mose Hansen <kde at mosehansen.dk>:
> > On Wednesday 28 October 2009 23:00:58 Simon St James wrote:
> >> I'm not sure if you hunted these down manually, but I have a locally
> >>  patched  GDB that warns on all C-style cast, and gives a breakdown of
> >> how they are interpreted (static_cast, static_cast from base to derived
> >> [pointer/ reference], reinterpret_cast, const_cast etc).  Is there any
> >> interest in having a list of all of these for some KDE modules at all?
> >
> > I would love to get that for Klipper. Should be a quick run!
> >
> > --
> > kind regards, Esben
> 





More information about the kde-core-devel mailing list