Mercurial > hg > svcore
diff plugin/NativeVampPluginFactory.cpp @ 1586:841b2a3e606d
Merge from branch fix-static-analysis
author | Chris Cannam |
---|---|
date | Wed, 09 Jan 2019 15:24:38 +0000 |
parents | 70e172e6cc59 |
children | 5750b9e60818 |
line wrap: on
line diff
--- a/plugin/NativeVampPluginFactory.cpp Wed Jan 09 14:39:50 2019 +0000 +++ b/plugin/NativeVampPluginFactory.cpp Wed Jan 09 15:24:38 2019 +0000 @@ -44,7 +44,7 @@ PluginDeletionNotifyAdapter(Vamp::Plugin *plugin, NativeVampPluginFactory *factory) : PluginWrapper(plugin), m_factory(factory) { } - virtual ~PluginDeletionNotifyAdapter(); + ~PluginDeletionNotifyAdapter() override; protected: NativeVampPluginFactory *m_factory; }; @@ -54,7 +54,7 @@ // see notes in vamp-sdk/hostext/PluginLoader.cpp from which this is drawn Vamp::Plugin *p = m_plugin; delete m_plugin; - m_plugin = 0; + m_plugin = nullptr; // acceptable use after free here, as pluginDeleted uses p only as // pointer key and does not deref it if (m_factory) m_factory->pluginDeleted(p); @@ -147,7 +147,7 @@ cerr << "NativeVampPluginFactory::getPluginIdentifiers: Vamp descriptor found" << endl; #endif - const VampPluginDescriptor *descriptor = 0; + const VampPluginDescriptor *descriptor = nullptr; int index = 0; map<string, int> known; @@ -293,10 +293,10 @@ { Profiler profiler("NativeVampPluginFactory::instantiatePlugin"); - Vamp::Plugin *rv = 0; - Vamp::PluginHostAdapter *plugin = 0; + Vamp::Plugin *rv = nullptr; + Vamp::PluginHostAdapter *plugin = nullptr; - const VampPluginDescriptor *descriptor = 0; + const VampPluginDescriptor *descriptor = nullptr; int index = 0; QString type, soname, label; @@ -305,14 +305,14 @@ #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE cerr << "NativeVampPluginFactory::instantiatePlugin: Wrong factory for plugin type " << type << endl; #endif - return 0; + return nullptr; } QString found = findPluginFile(soname); if (found == "") { SVDEBUG << "NativeVampPluginFactory::instantiatePlugin: Failed to find library file " << soname << endl; - return 0; + return nullptr; } else if (found != soname) { #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE @@ -328,7 +328,7 @@ if (!libraryHandle) { SVDEBUG << "NativeVampPluginFactory::instantiatePlugin: Failed to load library " << soname << ": " << DLERROR() << endl; - return 0; + return nullptr; } VampGetPluginDescriptorFunction fn = (VampGetPluginDescriptorFunction)