diff transform/FeatureExtractionModelTransformer.cpp @ 1830:5f8fbbde08ff audio-source-refactor

Use shared_ptr for plugin instances throughout
author Chris Cannam
date Fri, 20 Mar 2020 16:30:33 +0000
parents 4eac4bf35b45
children 1b688ab5f1b3
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Fri Mar 20 16:30:16 2020 +0000
+++ b/transform/FeatureExtractionModelTransformer.cpp	Fri Mar 20 16:30:33 2020 +0000
@@ -266,7 +266,8 @@
             << QThread::currentThreadId() << endl;
 
     try {
-        delete m_plugin;
+        m_plugin = {}; // does not necessarily delete, as it's a
+                       // shared_ptr, but in the design case it will
     } catch (const std::exception &e) {
         // A destructor shouldn't throw an exception. But at one point
         // (now fixed) our plugin stub destructor could have
@@ -274,7 +275,6 @@
         SVCERR << "FeatureExtractionModelTransformer: caught exception while deleting plugin: " << e.what() << endl;
         m_message = e.what();
     }
-    m_plugin = nullptr;
 
     m_descriptors.clear();
 }