瀏覽代碼

libobs: Finalise source creation before firing signal

Fixes a possible crash when renaming a source during the source_create
signal callback as it has not been added to the hash table yet.
derrod 2 年之前
父節點
當前提交
3bb101d7a2
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      libobs/obs-source.c

+ 1 - 1
libobs/obs-source.c

@@ -409,11 +409,11 @@ obs_source_create_internal(const char *id, const char *name, const char *uuid,
 	source->flags = source->default_flags;
 	source->enabled = true;
 
+	obs_source_init_finalize(source);
 	if (!private) {
 		obs_source_dosignal(source, "source_create", NULL);
 	}
 
-	obs_source_init_finalize(source);
 	return source;
 
 fail: