changeset 29574:0aa36133f638

Add a dealloc function to corevideo to reduce the memleaks from (for my sample) about 12 MB to 2 MB.
author reimar
date Tue, 01 Sep 2009 21:12:33 +0000
parents 2b14be337eaf
children 0e182921966b
files libvo/vo_corevideo.m
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_corevideo.m	Tue Sep 01 20:09:01 2009 +0000
+++ b/libvo/vo_corevideo.m	Tue Sep 01 21:12:33 2009 +0000
@@ -480,6 +480,17 @@
 	texture = NULL;
 }
 
+- (void) dealloc
+{
+	[self releaseVideoSpecific];
+	CVOpenGLTextureCacheRelease(textureCache);
+	textureCache = NULL;
+	[self setOpenGLContext:nil];
+	[glContext release];
+	glContext = NULL;
+	[super dealloc];
+}
+
 - (void) config
 {
 	uint32_t d_width;