From e3dd3d565c36a2568a6192bd6a4ca000fe63fd1b Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 10 Dec 2012 00:59:39 +0100 Subject: [PATCH] fix 2 leaks --- apps/openmw/mwsound/ffmpeg_decoder.cpp | 5 +++++ apps/openmw/mwworld/store.hpp | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index a2cccfd13..5f61ab8f0 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -313,7 +313,12 @@ void FFmpeg_Decoder::close() mStreams.erase(mStreams.begin()); } if(mFormatCtx) + { + AVIOContext* context = mFormatCtx->pb; + av_free(context); + mFormatCtx->pb = NULL; av_close_input_file(mFormatCtx); + } mFormatCtx = NULL; mDataStream.setNull(); diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index fd93f39f1..046de8c63 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -287,6 +287,16 @@ namespace MWWorld public: typedef SharedIterator iterator; + virtual ~Store() + { + for (std::vector::const_iterator it = + mStatic.begin(); it != mStatic.end(); ++it) + { + delete *it; + } + + } + int getSize() const { return mStatic.size(); }