LADSPA/CMT: fixed global initialization on Win32
Global initialization happens via a global startup/shutdown handler instance. For some reason this does not work properly when building a DLL file, therefore create this startup/shutdown handler instance as a static variable in ladspa_descriptor(). Furthermore marked ladspa_descriptor as extern-C.
This commit is contained in:
@@ -108,18 +108,26 @@ public:
|
||||
finalise_modules();
|
||||
}
|
||||
|
||||
} g_oStartupShutdownHandler;
|
||||
} ;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
const LADSPA_Descriptor *
|
||||
ladspa_descriptor(unsigned long Index) {
|
||||
|
||||
static StartupShutdownHandler handler;
|
||||
|
||||
if (Index < g_lPluginCount)
|
||||
return g_ppsRegisteredDescriptors[Index];
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* EOF */
|
||||
|
||||
Reference in New Issue
Block a user