[vlc-devel] [3.x v2 2/4] vout/caopengllayer: fix crash on close
Marvin Scholz
epirat07 at gmail.com
Thu Feb 20 16:14:07 CET 2020
The CGL context was destroyed too early, so move around the
vout display removal to prevent using the already-gone context.
---
modules/video_output/caopengllayer.m | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 133aab06f4..74dd049536 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -224,6 +224,11 @@ static void Close (vlc_object_t *p_this)
vout_display_t *vd = (vout_display_t *)p_this;
vout_display_sys_t *sys = vd->sys;
+ if (sys->vgl != NULL && !OpenglLock(sys->gl)) {
+ vout_display_opengl_Delete(sys->vgl);
+ OpenglUnlock(sys->gl);
+ }
+
if (sys->cgLayer) {
if ([sys->container respondsToSelector:@selector(removeVoutLayer:)])
[sys->container removeVoutLayer:sys->cgLayer];
@@ -242,11 +247,6 @@ static void Close (vlc_object_t *p_this)
if (sys->embed)
vout_display_DeleteWindow(vd, sys->embed);
- if (sys->vgl != NULL && !OpenglLock(sys->gl)) {
- vout_display_opengl_Delete(sys->vgl);
- OpenglUnlock(sys->gl);
- }
-
if (sys->gl != NULL)
{
if (sys->gl->sys != NULL)
--
2.21.1 (Apple Git-122.3)
More information about the vlc-devel
mailing list