libobs: Check source textures before destroying

Check to make sure the texrenders and textures on a source are valid
before destroying.
This commit is contained in:
jp9000
2015-10-21 07:46:40 -07:00
parent d242004bee
commit 485a006215
+6 -3
View File
@@ -370,9 +370,12 @@ void obs_source_destroy(struct obs_source *source)
obs_source_frame_decref(source->async_cache.array[i].frame);
gs_enter_context(obs->video.graphics);
gs_texrender_destroy(source->async_convert_texrender);
gs_texture_destroy(source->async_texture);
gs_texrender_destroy(source->filter_texrender);
if (source->async_convert_texrender)
gs_texrender_destroy(source->async_convert_texrender);
if (source->async_texture)
gs_texture_destroy(source->async_texture);
if (source->filter_texrender)
gs_texrender_destroy(source->filter_texrender);
gs_leave_context();
for (i = 0; i < MAX_AV_PLANES; i++)