Ver código fonte

obs-transitions: Make sure gs calls are in graphics context

This would cause a memory leak when toggling the track matte
transition.
Clayton Groeneveld 4 anos atrás
pai
commit
e1580d12fb
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      plugins/obs-transitions/transition-stinger.c

+ 4 - 0
plugins/obs-transitions/transition-stinger.c

@@ -143,6 +143,8 @@ static void stinger_update(void *data, obs_data_t *settings)
 	}
 
 	if (s->track_matte_enabled != track_matte_was_enabled) {
+		obs_enter_graphics();
+
 		gs_texrender_destroy(s->matte_tex);
 		gs_texrender_destroy(s->stinger_tex);
 		s->matte_tex = NULL;
@@ -153,6 +155,8 @@ static void stinger_update(void *data, obs_data_t *settings)
 			s->stinger_tex =
 				gs_texrender_create(GS_RGBA, GS_ZS_NONE);
 		}
+
+		obs_leave_graphics();
 	}
 }