mirror of https://github.com/odrling/Aegisub
avisynth: Properly destruct the IScriptEnvironment
Starting with AVISYNTH_INTERFACE_VERSION=5, this is how script environments should be deleted. The previous code was causing crashes when unloading AviSynth in certain scenarios, such as when failing to open a file due to an incorrect path.
This commit is contained in:
parent
ce1b3a0158
commit
ad443dd118
|
@ -105,7 +105,7 @@ AviSynthWrapper::AviSynthWrapper() {
|
||||||
|
|
||||||
AviSynthWrapper::~AviSynthWrapper() {
|
AviSynthWrapper::~AviSynthWrapper() {
|
||||||
if (!--avs_refcount) {
|
if (!--avs_refcount) {
|
||||||
delete env;
|
env->DeleteScriptEnvironment();
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
FreeLibrary(hLib);
|
FreeLibrary(hLib);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue