From 0d0ed49546f419b4b7fd90cc33f14c207fafedf1 Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Fri, 13 Jan 2023 23:52:27 +0100 Subject: [PATCH] vapoursynth: Only set loaded when fully initialized --- src/vapoursynth_wrap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vapoursynth_wrap.cpp b/src/vapoursynth_wrap.cpp index ac2b87dff..33c7de659 100644 --- a/src/vapoursynth_wrap.cpp +++ b/src/vapoursynth_wrap.cpp @@ -56,7 +56,6 @@ typedef VSSCRIPTAPI* VS_CC FUNC(int); VapourSynthWrapper::VapourSynthWrapper() { // VSScript assumes it's only loaded once, so unlike AVS we can't unload it when the refcount reaches zero if (!vs_loaded) { - vs_loaded = true; #ifdef _WIN32 #define CONCATENATE(x, y) x ## y #define _Lstr(x) CONCATENATE(L, x) @@ -92,6 +91,8 @@ VapourSynthWrapper::VapourSynthWrapper() { if (!api) throw VapoursynthError("Failed to get Vapoursynth API"); + + vs_loaded = true; } }