# HG changeset patch # User Chris Cannam # Date 1547135541 0 # Node ID f92587bedb2c3f7c644eaee368fb39d6f8de35d2 # Parent 0120dac53a69362983be3a4c32d4c870ef149ce7 Further small tidying diff -r 0120dac53a69 -r f92587bedb2c PyExtensionManager.cpp --- a/PyExtensionManager.cpp Thu Jan 10 15:44:39 2019 +0000 +++ b/PyExtensionManager.cpp Thu Jan 10 15:52:21 2019 +0000 @@ -135,7 +135,6 @@ void PyExtensionManager::cleanLocalNamespace(const char* plugModuleName) const { - /// these references are all borrowed PyObject *pyPlugModule = PyDict_GetItemString(m_pyGlobalNamespace,plugModuleName); if (!pyPlugModule) return; @@ -183,6 +182,8 @@ cerr << "Vampy::PyExtensionManager::updateLocalNamespace: Failed: " << name << " of "<< plugModuleName << endl; else DSTREAM << "Updated local name: " << name << endl; + } else { + DSTREAM << "Local namespace does not contain name: " << name << endl; } Py_DECREF(key); } @@ -192,7 +193,6 @@ bool PyExtensionManager::cleanModule(void) const { - PyObject *m = PyImport_AddModule("vampy"); if (!m) { if (PyErr_Occurred()) {PyErr_Print(); PyErr_Clear();} diff -r 0120dac53a69 -r f92587bedb2c PyPlugin.cpp --- a/PyPlugin.cpp Thu Jan 10 15:44:39 2019 +0000 +++ b/PyPlugin.cpp Thu Jan 10 15:52:21 2019 +0000 @@ -64,9 +64,10 @@ Py_CLEAR(args); Py_CLEAR(pyInputSampleRate); cerr << "PyPlugin::PyPlugin: Failed to create Python plugin instance for key \"" - << pluginKey << "\" (is the 1-arg class constructor from sample rate correctly provided?)" << endl; + << pluginKey << "\" (is the 1-arg class constructor from sample rate correctly provided?)" << endl; throw std::string("Constructor failed"); } + Py_INCREF(m_pyInstance); Py_DECREF(args); Py_DECREF(pyInputSampleRate);