From 7d9437c8a5fed2d03c22454f643b4bf5598f2d9e Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 26 Feb 2005 04:57:48 +0000 Subject: - garbage collection at module scope - better handling of bang messages better error reporting svn path=/trunk/; revision=2583 --- externals/grill/py/readme.txt | 3 ++- externals/grill/py/source/main.cpp | 4 +++- externals/grill/py/source/main.h | 2 +- externals/grill/py/source/pyext.cpp | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/externals/grill/py/readme.txt b/externals/grill/py/readme.txt index 1aa18022..ba16e3ff 100644 --- a/externals/grill/py/readme.txt +++ b/externals/grill/py/readme.txt @@ -150,8 +150,9 @@ general: features: - enable multiple interpreters? ( -> not possible within one thread) +- options to fully detach a script (included initialization and finalization) - stop individual threads - support named (keyword) arguments (like attributes for messages) tests: -- check for python threading support +- compile-time check for python threading support diff --git a/externals/grill/py/source/main.cpp b/externals/grill/py/source/main.cpp index bf7345d5..3b75f419 100644 --- a/externals/grill/py/source/main.cpp +++ b/externals/grill/py/source/main.cpp @@ -556,7 +556,7 @@ short py::patcher_myvol(t_patcher *x) } #endif -void py::collect() +bool py::collect() { if(gcollect) { PyObject *args = PyTuple_New(0); @@ -568,8 +568,10 @@ void py::collect() if(refs) post("py/pyext - Garbage collector reports %i unreachable objects",refs); #endif Py_DECREF(ret); + return false; } } + return true; } Fifo::~Fifo() diff --git a/externals/grill/py/source/main.h b/externals/grill/py/source/main.h index 621c9eff..b7000bae 100644 --- a/externals/grill/py/source/main.h +++ b/externals/grill/py/source/main.h @@ -132,7 +132,7 @@ protected: static short patcher_myvol(t_patcher *x); #endif - static void collect(); + static bool collect(); private: diff --git a/externals/grill/py/source/pyext.cpp b/externals/grill/py/source/pyext.cpp index de208aac..5a870d10 100644 --- a/externals/grill/py/source/pyext.cpp +++ b/externals/grill/py/source/pyext.cpp @@ -244,7 +244,9 @@ void pyext::DoExit() Py_DECREF(pyobj); // opposite of SetClssMeth } - if(gcrun) collect(); + if(gcrun && !collect()) { + post("%s - Unloading: Object is still referenced",thisName()); + } } void pyext::InitInOut(int &inl,int &outl) -- cgit v1.2.1