Mercurial > hg > vamp-plugin-sdk
comparison src/vamp-sdk/PluginAdapter.cpp @ 285:9abf7455a1a3
* Fix crash when an adapter's createPlugin() fails in getDescriptor()
author | cannam |
---|---|
date | Mon, 17 Aug 2009 13:42:55 +0000 |
parents | 6579e441f2fe |
children | 34754c776530 |
comparison
equal
deleted
inserted
replaced
284:1ed95908a397 | 285:9abf7455a1a3 |
---|---|
166 #endif | 166 #endif |
167 | 167 |
168 if (m_populated) return &m_descriptor; | 168 if (m_populated) return &m_descriptor; |
169 | 169 |
170 Plugin *plugin = m_base->createPlugin(48000); | 170 Plugin *plugin = m_base->createPlugin(48000); |
171 | |
172 if (!plugin) { | |
173 std::cerr << "PluginAdapterBase::Impl::getDescriptor: Failed to create plugin" << std::endl; | |
174 return 0; | |
175 } | |
171 | 176 |
172 if (plugin->getVampApiVersion() != VAMP_API_VERSION) { | 177 if (plugin->getVampApiVersion() != VAMP_API_VERSION) { |
173 std::cerr << "Vamp::PluginAdapterBase::Impl::getDescriptor: ERROR: " | 178 std::cerr << "Vamp::PluginAdapterBase::Impl::getDescriptor: ERROR: " |
174 << "API version " << plugin->getVampApiVersion() | 179 << "API version " << plugin->getVampApiVersion() |
175 << " for\nplugin \"" << plugin->getIdentifier() << "\" " | 180 << " for\nplugin \"" << plugin->getIdentifier() << "\" " |