[vlc-commits] caopengllayer: release context before releasing object

David Fuhrmann git at videolan.org
Fri Feb 9 22:23:35 CET 2018


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Fri Feb  9 22:15:15 2018 +0100| [1504a133a4325deb88de2004dfcec5caf34738c0] | committer: David Fuhrmann

caopengllayer: release context before releasing object

Context should be released before the holding object is destroyed.

CD: 7faf260f-418b-4827-a692-6b497130c7f1

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

 modules/video_output/caopengllayer.m | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 982ed830a9..a8cffadb61 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -238,6 +238,10 @@ static void Close (vlc_object_t *p_this)
             [sys->container removeVoutLayer:sys->cgLayer];
         else
             [sys->cgLayer removeFromSuperlayer];
+
+        if ([sys->cgLayer glContext])
+            CGLReleaseContext([sys->cgLayer glContext]);
+
         [sys->cgLayer release];
     }
 
@@ -262,9 +266,6 @@ static void Close (vlc_object_t *p_this)
         vlc_object_release(sys->gl);
     }
 
-    if ([sys->cgLayer glContext])
-        CGLReleaseContext([sys->cgLayer glContext]);
-
     free(sys);
 }
 



More information about the vlc-commits mailing list