vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrm...@videolan.org> | Fri 
Feb  9 22:15:15 2018 +0100| [33005c19fa6f2cca9efee1447bf69d068b3d3ae6] | 
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
(cherry picked from commit 1504a133a4325deb88de2004dfcec5caf34738c0)
Signed-off-by: David Fuhrmann <dfuhrm...@videolan.org>

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

 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);
 }
 

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to