]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/vulkan: allow calling glslang_uninit without a prior init
authorLynne <dev@lynne.ee>
Sun, 22 Nov 2020 22:08:33 +0000 (23:08 +0100)
committerLynne <dev@lynne.ee>
Wed, 25 Nov 2020 22:06:34 +0000 (23:06 +0100)
Allows us to uninit cleanly.
This assert was also somewhat pointless as we assert every other
function, so another assert would be triggered long before this
one is.

libavfilter/glslang.cpp

index 125eb5c364bad0b3f016a4321377b85c38534dcc..986bddd789d0b42bab547097e2326fc82b38a298 100644 (file)
@@ -235,8 +235,7 @@ int glslang_init(void)
 void glslang_uninit(void)
 {
     pthread_mutex_lock(&glslang_mutex);
-    av_assert0(glslang_refcount > 0);
-    if (--glslang_refcount == 0)
+    if (glslang_refcount && (--glslang_refcount == 0))
         FinalizeProcess();
     pthread_mutex_unlock(&glslang_mutex);
 }