290 |
return true; |
return true; |
291 |
} |
} |
292 |
|
|
293 |
|
//NOTE: method currently not used at all, see FIXME comment below why |
294 |
void InstrumentEditorFactory::ClosePlugins() { |
void InstrumentEditorFactory::ClosePlugins() { |
295 |
if (LoadedDLLs.size()) { |
if (LoadedDLLs.size()) { |
296 |
dmsg(1,("Unloading instrument editor plugins...")); |
dmsg(1,("Unloading instrument editor plugins...")); |
297 |
// free all inner factories |
// free all inner factories |
298 |
{ |
{ |
299 |
|
//FIXME: potential race with 'InnerFactoryRegistrator' |
300 |
|
// destructor, the latter is executed deferred when the DLL is |
301 |
|
// eventually unloaded by the OS, and that in turn seems to have |
302 |
|
// created a race when this method was called in the past on |
303 |
|
// LSCP "RESET" command, leading to the situation that plugins |
304 |
|
// were not available as bPluginsLoaded ended up true due to |
305 |
|
// LoadPlugins() call while the subsequent deferred destructor |
306 |
|
// removed the plugin instances without resetting bPluginsLoaded |
307 |
|
// https://sourceforge.net/p/linuxsampler/mailman/message/37411956/ |
308 |
std::map<String, InnerFactory*>::iterator iter = InnerFactories.begin(); |
std::map<String, InnerFactory*>::iterator iter = InnerFactories.begin(); |
309 |
for (; iter != InnerFactories.end(); iter++) delete iter->second; |
for (; iter != InnerFactories.end(); iter++) delete iter->second; |
310 |
InnerFactories.clear(); |
InnerFactories.clear(); |