diff native/PyPluginObject.cpp @ 124:bea7cf4126b5

Add RealTime tests, simplify allocations & a couple of fixes
author Chris Cannam
date Wed, 24 Jun 2015 14:11:19 +0100
parents 2370b942cd32
children 1f23d18883a1
line wrap: on
line diff
--- a/native/PyPluginObject.cpp	Wed Jun 24 10:50:13 2015 +0100
+++ b/native/PyPluginObject.cpp	Wed Jun 24 14:11:19 2015 +0100
@@ -82,8 +82,9 @@
 PyObject *
 PyPluginObject_From_Plugin(Plugin *plugin)
 {
-    PyPluginObject *pd = 
-        (PyPluginObject *)PyType_GenericAlloc(&Plugin_Type, 0);
+    PyPluginObject *pd = PyObject_New(PyPluginObject, &Plugin_Type);
+    if (!pd) return 0;
+    
     pd->plugin = plugin;
     pd->isInitialised = false;
     pd->channels = 0;
@@ -821,9 +822,9 @@
     0,                                  /*tp_descr_set*/
     0,                                  /*tp_dictoffset*/
     0,                                  /*tp_init*/
-    PyType_GenericAlloc,                /*tp_alloc*/
+    0,                                  /*tp_alloc*/
     0,                                  /*tp_new*/
-    PyObject_Del,                       /*tp_free*/
+    0,                                  /*tp_free*/
     0,                                  /*tp_is_gc*/
 };