Mercurial > hg > svcore
comparison transform/FeatureExtractionModelTransformer.cpp @ 1832:7c92c644db20
Merge from branch audio-source-refactor. Various changes to memory management for plugins, ring buffers etc, for safer code further up the stack
author | Chris Cannam |
---|---|
date | Fri, 03 Apr 2020 12:12:02 +0100 |
parents | 5f8fbbde08ff |
children | 1b688ab5f1b3 |
comparison
equal
deleted
inserted
replaced
1831:498ed1e86f92 | 1832:7c92c644db20 |
---|---|
264 { | 264 { |
265 SVDEBUG << "FeatureExtractionModelTransformer: deleting plugin for transform in thread " | 265 SVDEBUG << "FeatureExtractionModelTransformer: deleting plugin for transform in thread " |
266 << QThread::currentThreadId() << endl; | 266 << QThread::currentThreadId() << endl; |
267 | 267 |
268 try { | 268 try { |
269 delete m_plugin; | 269 m_plugin = {}; // does not necessarily delete, as it's a |
270 // shared_ptr, but in the design case it will | |
270 } catch (const std::exception &e) { | 271 } catch (const std::exception &e) { |
271 // A destructor shouldn't throw an exception. But at one point | 272 // A destructor shouldn't throw an exception. But at one point |
272 // (now fixed) our plugin stub destructor could have | 273 // (now fixed) our plugin stub destructor could have |
273 // accidentally done so, so just in case: | 274 // accidentally done so, so just in case: |
274 SVCERR << "FeatureExtractionModelTransformer: caught exception while deleting plugin: " << e.what() << endl; | 275 SVCERR << "FeatureExtractionModelTransformer: caught exception while deleting plugin: " << e.what() << endl; |
275 m_message = e.what(); | 276 m_message = e.what(); |
276 } | 277 } |
277 m_plugin = nullptr; | |
278 | 278 |
279 m_descriptors.clear(); | 279 m_descriptors.clear(); |
280 } | 280 } |
281 | 281 |
282 void | 282 void |