From ff1a1f722dcf07bbd61e1028935543c80d35f3a5 Mon Sep 17 00:00:00 2001 From: Andre Pang Date: Tue, 22 Jun 2004 08:25:24 +0000 Subject: Mac OS X XineOpenGLView: Added dealloc method Removed unused opengl_context field Added NSCoding functions, in preparation for Interface Builder palettization Mac OS X XineVideoWindow: Added dealloc method CVS patchset: 6729 CVS date: 2004/06/22 08:25:24 --- src/video_out/macosx/video_window.h | 1 - src/video_out/macosx/video_window.m | 41 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_out/macosx/video_window.h b/src/video_out/macosx/video_window.h index af84e4c4e..44b157f00 100644 --- a/src/video_out/macosx/video_window.h +++ b/src/video_out/macosx/video_window.h @@ -38,7 +38,6 @@ typedef enum { BOOL initDone; BOOL isFullScreen; XineVideoWindowFullScreenMode fullscreen_mode; - NSOpenGLContext * opengl_context; NSOpenGLContext * fullScreenContext; NSOpenGLContext * currentContext; } diff --git a/src/video_out/macosx/video_window.m b/src/video_out/macosx/video_window.m index b70d9c0ce..d4fc12786 100644 --- a/src/video_out/macosx/video_window.m +++ b/src/video_out/macosx/video_window.m @@ -89,6 +89,14 @@ NSString *XineViewDidResizeNotification = @"XineViewDidResizeNotification"; return self; } +- (void) dealloc +{ + [xineView release]; + + [super dealloc]; +} + + - (XineOpenGLView *) xineView { return xineView; } @@ -212,6 +220,39 @@ NSString *XineViewDidResizeNotification = @"XineViewDidResizeNotification"; return self; } +- (id) initWithCoder:(NSCoder *)coder +{ + [super initWithCoder:coder]; + + self = [self initWithFrame:[self frame]]; + return self; +} + +- (void) encodeWithCoder:(NSCoder *)coder +{ + [super encodeWithCoder:coder]; +} + + +- (void) dealloc { + if (texture_buffer) + free (texture_buffer); + + if (fullScreenContext) { + [NSOpenGLContext clearCurrentContext]; + [fullScreenContext clearDrawable]; + [fullScreenContext release]; + } + + if (currentContext) { + [NSOpenGLContext clearCurrentContext]; + [currentContext clearDrawable]; + [currentContext release]; + } + + [super dealloc]; +} + - (void) reshape { if (!initDone) return; -- cgit v1.2.3