Thread: Avisynth+
View Single Post
Old 27th June 2016, 15:08   #1851  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by MysteryX View Post
The VDub destructor bug isn't so easy to fix; but shouldn't be hard for someone who understands the code better.

Code:
  // VDubFilter.cpp
  void CallEndProc() {
    if (fd->endProc) {
      int result = fd->endProc(&fa, &g_filterFuncs);
      if (result != 0) {
        throw AvisynthError("VirtualdubFilterProxy: error calling endProc");
      }
    }
  }
Basically, Deshaker's EndProc is trying to access "something" within fa that is no longer accessible at that time.

Commenting both of these lines does solve the problem, but I doubt it is the right fix
Code:
// in FilterAdd
fm->env->AtExit(FreeFilterDefinition, fd);

// in LoadVirtualdubPlugin
env->AtExit(FreeFilterModule, fm);
The destructor needs to be called before these 2 functions.

I'll let you fix it before I start adding a "release timer" to fix the sequence
Did you checked the last commit? It is not yet in the last pfmod release, there were changes integrated from classic avs regarding "Fix VDub plugin race on cleanup"
pinterf is offline