[vlc-devel] [PATCH 2/2] vgl: don't call cleanup callback if nothing has done

Zhao Zhili quinkblack at foxmail.com
Thu Aug 23 11:24:19 CEST 2018


---
 modules/video_output/vgl.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/vgl.c b/modules/video_output/vgl.c
index 6af8c67..6a69a37 100644
--- a/modules/video_output/vgl.c
+++ b/modules/video_output/vgl.c
@@ -99,7 +99,7 @@ static void Close(vlc_object_t *object)
         var = var_InheritAddress(gl, varname);                     \
         if( !var ) {                                               \
             msg_Err( gl, "%s address is missing", varname );       \
-            goto error;                                            \
+            return VLC_EGENERIC;                                   \
         }                                                          \
     } while( 0 )
 
@@ -131,14 +131,10 @@ static int Open(vlc_object_t *object)
         if( !sys->setupCb(sys->opaque) )
         {
             msg_Err( gl, "user setup failed" );
-            goto error;
+            return VLC_EGENERIC;
         }
 
     return VLC_SUCCESS;
-
-error:
-    Close(object);
-    return VLC_EGENERIC;
 }
 
 #undef SET_CALLBACK_ADDR
-- 
2.9.5





More information about the vlc-devel mailing list