you obviously using VC compiler - so why the "C API" ?
I want to exclude any problems that can be caused by different versions of VC compiler. I think the official AviSynth builds are compiled with VC6 or VC8 and I'm using VC12. Microsoft recommends using C interfaces, that are designed to have a stable ABI between compiler releases. But I also tried the c++ Interface which causes exactly the same problem.
may be memory gets corrupted on "p_release(ret);" call as "LoadPlugin" actually doesn't return anything
avs_invoke has a return value (type AVS_Value) which must be released with avs_release_value (http://www.kevina.org/avisynth_c/api.html). The Variable ret actually holds a string saying: "svpflow1: part of SmoothVideo Project frame interpolation engine based on MVTools2 plugin".
- linked against avisynth.lib
what version? where you get this .lib?
keep in mind that 2.5.8 avisynth.h have plenty of stuff (including common classes destructors) defined in the header (and so they're compiled into plugins) and 2.6 doesn't
You have to link against avisynth.lib if the c API is used. The lib is located in the installation folder of AviSynth if some ??? option is checked during installation process. I'm currently using version 2.5.8
Long story short. I have tryed any possesible combination of different AviSynth releases and their APIs. The ScriptEnviroment cannot be freed without a crash. Either env->DeleteScriptEnvironment() or avs_delete_script_environment(env) work after the svpflow dlls are loaded. The only possible solution to overcome this issue is to skip those calls and directly unload the AviSynth Module which should release all ressources. BUT that's pretty annoying because my application needs two ScriptEnviroments which are owned by two threads. If one thread resets its ScriptEnviroment the other thread will loose its Environment too. I hope there is some better solution. I'm not even sure if its a VC12 related problem or something else.