浏览代码

libobs: Warn if source released after shutdown

Instead of letting this area of code crash, check to see if the core is
still active or not, and safely warn and ignore the release if so.
jp9000 10 年之前
父节点
当前提交
9d82760405
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      libobs/obs-source.c

+ 6 - 0
libobs/obs-source.c

@@ -308,6 +308,12 @@ void obs_source_addref(obs_source_t *source)
 
 void obs_source_release(obs_source_t *source)
 {
+	if (!obs) {
+		blog(LOG_WARNING, "Tried to release a source when the OBS "
+		                  "core is shut down!");
+		return;
+	}
+
 	if (!source)
 		return;