Review Request: Prevent memory leaks when opening a zip store multiple times

Sebastian Sauer mail at dipe.org
Fri Oct 8 13:29:53 BST 2010



> On 2010-10-07 13:11:50, Sebastian Sauer wrote:
> > Wouldn't it be better if terminate() is just called as the first action if init() is called again? That way we would keep the previous behavior to just open again (and don't ignore e.g. another mode passed on to init()) and lose the old state (but this time without losing mem). Also I guess the same check+call of terminate() needs to happen in the dtor.
> >
> 
> Sebastian Sauer wrote:
>     > Wouldn't it be better if terminate() is just called as the first action if init() is called again?
>     I mean if the user didn't called it manually ;)

> Like this?
Yes, looks perfect imho :)


- Sebastian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5536/#review8014
-----------------------------------------------------------


On 2010-10-07 19:36:50, Boudewijn Rempt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5536/
> -----------------------------------------------------------
> 
> (Updated 2010-10-07 19:36:50)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> It is possible to accidentally call open() twice. If you do that on a zip store, kgzipfilter will be initialized twice, deflateInit2 will be called twice and we leak memory.
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdelibs/kdecore/compression/kbzip2filter.cpp 1182756 
>   trunk/KDE/kdelibs/kdecore/compression/kfilterdev.cpp 1182756 
>   trunk/KDE/kdelibs/kdecore/compression/kgzipfilter.cpp 1182756 
>   trunk/KDE/kdelibs/kdecore/compression/kxzfilter.cpp 1182756 
> 
> Diff: http://svn.reviewboard.kde.org/r/5536/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Boudewijn
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20101008/d25243d6/attachment.htm>


More information about the kde-core-devel mailing list