1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-15 15:50:54 +02:00

Module dispatch function is now optional.

This commit is contained in:
james.k.crook@gmail.com 2014-06-20 15:50:02 +00:00
parent fc2bd3faa4
commit b160c728bc

View File

@ -126,9 +126,12 @@ bool Module::Load()
mDispatch = (fnModuleDispatch) mLib->GetSymbol(wxT(ModuleDispatchName));
if (!mDispatch) {
// Module does not provide a dispatch function...
return false;
// That can be OK, as long as we never try to call it.
return true;
}
// However if we do have it and it does not work,
// then the module is bad.
bool res = ((mDispatch(ModuleInitialize))!=0);
if (res) {
return true;
@ -149,9 +152,9 @@ void Module::Unload()
int Module::Dispatch(ModuleDispatchTypes type)
{
if (mLib->IsLoaded()) {
if (mLib->IsLoaded())
if( mDispatch != NULL )
return mDispatch(type);
}
return 0;
}