Review Request 126526: [hg]Fixed memory leak
Tomasz Bojczuk
seelook at gmail.com
Sun Dec 27 16:51:59 GMT 2015
> On Dec. 27, 2015, 3:46 p.m., Mark Gaiser wrote:
> > This is exactly the reason (a forgotten delete) why i prefer to use smart pointers instead of naked pointers.
> > Could you put m_config in a std::unique_ptr<...> object? Or if you really want to use Qt smart pointers then put it in a QScopedPointer<...>.
But it doesn't match a type when KConfigGroup() is created with m_config as a first parameter. (Either for std::unique_ptr or QScopedPointer).
IMO, using destructor is much clearer and quite sufficient for this purpose.
- Tomasz
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126526/#review90147
-----------------------------------------------------------
On Dec. 26, 2015, 1:52 p.m., Tomasz Bojczuk wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126526/
> -----------------------------------------------------------
>
> (Updated Dec. 26, 2015, 1:52 p.m.)
>
>
> Review request for Dolphin.
>
>
> Repository: dolphin-plugins
>
>
> Description
> -------
>
> There is KConfig instance
> KConfig *m_config;
> It is created in constructor but never deleted (no destructor).
> Added destructor then.
> In occasion, when m_config is created - wrapped file name text by QLatin1String
>
>
> Diffs
> -----
>
> hg/config-widgets/pluginsettings.h 42d3cec
> hg/config-widgets/pluginsettings.cpp 2267a3a
>
> Diff: https://git.reviewboard.kde.org/r/126526/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Tomasz Bojczuk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20151227/51960284/attachment.htm>
More information about the kfm-devel
mailing list