mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-26 09:21:55 -04:00
libobs: Make sure all code paths leave context
Should always call `gs_leave_context` after `gs_enter_context` or it might cause a lock leave. This commit makes sure all code paths will call `gs_leave_context` if it called `gs_enter_context`.
This commit is contained in:
+6
-2
@@ -645,10 +645,14 @@ static int obs_init_video_mix(struct obs_video_info *ovi, struct obs_core_video_
|
||||
|
||||
gs_enter_context(obs->video.graphics);
|
||||
|
||||
if (video->gpu_conversion && !obs_init_gpu_conversion(video))
|
||||
if (video->gpu_conversion && !obs_init_gpu_conversion(video)) {
|
||||
gs_leave_context();
|
||||
return OBS_VIDEO_FAIL;
|
||||
if (!obs_init_textures(video))
|
||||
}
|
||||
if (!obs_init_textures(video)) {
|
||||
gs_leave_context();
|
||||
return OBS_VIDEO_FAIL;
|
||||
}
|
||||
|
||||
gs_leave_context();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user