Browse Source

Merge pull request #2463 from jpark37/filter-ref-count

libobs: Only manipulate input source ref counts
Jim 5 years ago
parent
commit
005de86f21
1 changed files with 4 additions and 2 deletions
  1. 4 2
      libobs/obs-source.c

+ 4 - 2
libobs/obs-source.c

@@ -958,7 +958,8 @@ static void deactivate_source(obs_source_t *source)
 
 static void show_source(obs_source_t *source)
 {
-	obs_source_addref(source);
+	if (source->info.type == OBS_SOURCE_TYPE_INPUT)
+		obs_source_addref(source);
 
 	if (source->context.data && source->info.show)
 		source->info.show(source->context.data);
@@ -971,7 +972,8 @@ static void hide_source(obs_source_t *source)
 		source->info.hide(source->context.data);
 	obs_source_dosignal(source, "source_hide", "hide");
 
-	obs_source_release(source);
+	if (source->info.type == OBS_SOURCE_TYPE_INPUT)
+		obs_source_release(source);
 }
 
 static void activate_tree(obs_source_t *parent, obs_source_t *child,