libobs: Add extra reference when source is displayed

This provides a chance to clean up resources on the graphics thread in
the hide callback, which Windows Graphics Capture requires.
This commit is contained in:
jpark37 2019-11-27 16:40:25 -08:00 committed by jp9000
parent 82cdc6e8c6
commit 9cff2ae6bb

View File

@ -958,6 +958,8 @@ static void deactivate_source(obs_source_t *source)
static void show_source(obs_source_t *source)
{
obs_source_addref(source);
if (source->context.data && source->info.show)
source->info.show(source->context.data);
obs_source_dosignal(source, "source_show", "show");
@ -968,6 +970,8 @@ static void hide_source(obs_source_t *source)
if (source->context.data && source->info.hide)
source->info.hide(source->context.data);
obs_source_dosignal(source, "source_hide", "hide");
obs_source_release(source);
}
static void activate_tree(obs_source_t *parent, obs_source_t *child,