mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 08:09:32 +02:00
Fix for bug #857
Even though this is only a P2, I felt it would be quite bothersome for the users and might cause some confusion. The problem was the the wxLocale was being deleted before all usage of it was complete. The fix was to explicitly delete the plugin and module managers.
This commit is contained in:
parent
c88c1738bb
commit
e73b7e70a3
@ -1908,6 +1908,10 @@ int AudacityApp::OnExit()
|
||||
// Terminate the PluginManager (must be done before deleting the locale)
|
||||
PluginManager::Get().Terminate();
|
||||
|
||||
// Done with plugins and modules
|
||||
PluginManager::Destroy();
|
||||
ModuleManager::Destroy();
|
||||
|
||||
if (mLocale)
|
||||
delete mLocale;
|
||||
|
||||
|
@ -178,7 +178,7 @@ void * Module::GetSymbol(wxString name)
|
||||
// ============================================================================
|
||||
|
||||
// The one and only ModuleManager
|
||||
ModuleManager ModuleManager::mInstance;
|
||||
ModuleManager *ModuleManager::mInstance = NULL;
|
||||
|
||||
// Provide builtin modules a means to identify themselves
|
||||
static wxArrayPtrVoid *pBuiltinModuleList = NULL;
|
||||
@ -358,7 +358,21 @@ int ModuleManager::Dispatch(ModuleDispatchTypes type)
|
||||
// ============================================================================
|
||||
ModuleManager & ModuleManager::Get()
|
||||
{
|
||||
return mInstance;
|
||||
if (!mInstance)
|
||||
{
|
||||
mInstance = new ModuleManager();
|
||||
}
|
||||
|
||||
return *mInstance;
|
||||
}
|
||||
|
||||
void ModuleManager::Destroy()
|
||||
{
|
||||
if (mInstance)
|
||||
{
|
||||
delete mInstance;
|
||||
mInstance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool ModuleManager::DiscoverProviders()
|
||||
|
@ -82,6 +82,7 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
static ModuleManager & Get();
|
||||
static void Destroy();
|
||||
|
||||
void Initialize(CommandHandler & cmdHandler);
|
||||
int Dispatch(ModuleDispatchTypes type);
|
||||
@ -106,7 +107,7 @@ private:
|
||||
void UnloadModule(ModuleInterface *module);
|
||||
|
||||
private:
|
||||
static ModuleManager mInstance;
|
||||
static ModuleManager *mInstance;
|
||||
|
||||
ModuleMainMap mModuleMains;
|
||||
ModuleMap mDynModules;
|
||||
|
@ -1360,7 +1360,7 @@ bool PluginManager::RemovePrivateConfig(const PluginID & ID, const wxString & gr
|
||||
// ============================================================================
|
||||
|
||||
// The one and only PluginManager
|
||||
PluginManager PluginManager::mInstance;
|
||||
PluginManager *PluginManager::mInstance = NULL;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Creation/Destruction
|
||||
@ -1392,7 +1392,20 @@ PluginManager::~PluginManager()
|
||||
|
||||
PluginManager & PluginManager::Get()
|
||||
{
|
||||
return mInstance;
|
||||
if (!mInstance)
|
||||
{
|
||||
mInstance = new PluginManager();
|
||||
}
|
||||
|
||||
return *mInstance;
|
||||
}
|
||||
|
||||
void PluginManager::Destroy()
|
||||
{
|
||||
if (mInstance)
|
||||
{
|
||||
delete mInstance;
|
||||
}
|
||||
}
|
||||
|
||||
void PluginManager::Initialize()
|
||||
@ -1947,10 +1960,6 @@ const PluginDescriptor *PluginManager::GetFirstPluginForEffectType(EffectType ty
|
||||
PluginDescriptor & plug = mPluginsIter->second;
|
||||
|
||||
bool familyEnabled;
|
||||
if (type == PluginTypeEffect)
|
||||
{
|
||||
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
|
||||
}
|
||||
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
|
||||
if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
|
||||
{
|
||||
|
@ -226,6 +226,7 @@ public:
|
||||
void Terminate();
|
||||
|
||||
static PluginManager & Get();
|
||||
static void Destroy();
|
||||
|
||||
static PluginID GetID(ModuleInterface *module);
|
||||
static PluginID GetID(EffectIdentInterface *effect);
|
||||
@ -301,7 +302,7 @@ private:
|
||||
int b64decode(wxString in, void *out);
|
||||
|
||||
private:
|
||||
static PluginManager mInstance;
|
||||
static PluginManager *mInstance;
|
||||
|
||||
bool IsDirty();
|
||||
void SetDirty(bool dirty = true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user