[vlc-commits] vout_macosx: fixed memory leak

Felix Paul Kühne git at videolan.org
Fri Aug 19 15:22:42 CEST 2011


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Aug 19 15:17:28 2011 +0200| [7fe71cc98d944a6e7b6f4aa38afb8a0c506846d0] | committer: Felix Paul Kühne

vout_macosx: fixed memory leak

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

 modules/video_output/macosx.m |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 08899a3..17f697d 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -207,8 +207,10 @@ static int Open(vlc_object_t *this)
     sys->gl.swap = OpenglSwap;
     sys->gl.getProcAddress = NULL;
     sys->gl.sys = sys;
+    const vlc_fourcc_t *subpicture_chromas;
+    video_format_t fmt = vd->fmt;
 
-	sys->vgl = vout_display_opengl_New(&vd->fmt, NULL, &sys->gl);
+	sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl);
 	if (!sys->vgl)
     {
         sys->gl.sys = NULL;
@@ -218,6 +220,8 @@ static int Open(vlc_object_t *this)
     /* */
     vout_display_info_t info = vd->info;
     info.has_pictures_invalid = false;
+    info.has_event_thread = true;
+    info.subpicture_chromas = subpicture_chromas;
 
     /* Setup vout_display_t once everything is fine */
     vd->info = info;
@@ -329,6 +333,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         {
+            NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
             NSPoint topleftbase;
             NSPoint topleftscreen;
             NSRect new_frame;
@@ -364,6 +369,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
 
                 [sys->glView performSelectorOnMainThread:@selector(setWindowFrameWithValue:) withObject:[NSValue valueWithRect:new_frame] waitUntilDone:NO];
             }
+            [o_pool release];
             return VLC_SUCCESS;
         }
 



More information about the vlc-commits mailing list