[vlc-devel] commit: macosx: VLCAdditions do not leak memory. (Jean-Paul Saman )

git version control git at videolan.org
Sun Jun 14 20:09:11 CEST 2009


vlc | branch: 1.0-bugfix | Jean-Paul Saman <jpsaman at videolan.org> | Sun Jun 14 12:43:11 2009 +0200| [ccc1a9c255de25dbe616b325c490fa0b64a3b5ae] | committer: Jean-Paul Saman 

macosx: VLCAdditions do not leak memory.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ccc1a9c255de25dbe616b325c490fa0b64a3b5ae
---

 modules/gui/macosx/misc.m |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 51927d7..ecf4f6c 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -102,6 +102,11 @@ static NSMapTable *VLCAdditions_userInfo = nil;
 - (void)dealloc
 {
     NSMapRemove(VLCAdditions_userInfo, self);
+    NSResetMapTable(VLCAdditions_userInfo);
+    /* NSCreateMapTable mallocs memory from the default zone ('malloc')
+     * thus releasing it with free() is save. */
+    free(VLCAdditions_userInfo);
+    VLCAdditions_userInfo = nil;
     [super dealloc];
 }
 




More information about the vlc-devel mailing list