From 99cf57eb393e61bc0a9072a6e4f4f21c57daea9d Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Fri, 1 Mar 2013 19:21:34 +1300 Subject: [PATCH] Fixes two memory leaks, one is pretty bad for OSX. Yell at pauldachz if this doesn't work. Or... say thanks. --- Source/Core/DiscIO/Src/WiiWad.cpp | 3 ++- .../InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/DiscIO/Src/WiiWad.cpp b/Source/Core/DiscIO/Src/WiiWad.cpp index 24e091f9f4..fa44108586 100644 --- a/Source/Core/DiscIO/Src/WiiWad.cpp +++ b/Source/Core/DiscIO/Src/WiiWad.cpp @@ -49,7 +49,8 @@ WiiWAD::WiiWAD(const std::string& _rName) if (pReader == NULL || File::IsDirectory(_rName)) { m_Valid = false; - return; + if(pReader) delete pReader; + return; } m_Valid = ParseWAD(*pReader); diff --git a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm index 56e360019a..c22e267044 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm +++ b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.mm @@ -69,6 +69,7 @@ bool Keyboard::UpdateInput() CGRectMakeWithDictionaryRepresentation(boundsDictionary, &bounds); } + CFRelease(windowDescriptions); CFRelease(windowArray); CGEventRef event = CGEventCreate(nil);