diff options
author | Josh Blum | 2013-04-03 23:31:34 -0700 |
---|---|---|
committer | Josh Blum | 2013-04-03 23:31:34 -0700 |
commit | c85fe5cb75d32544eb89a573e8df61757a940766 (patch) | |
tree | a1e0fb013bb2d31823738f5ab7de7b69316193ed /python/gras | |
parent | 0651aff49ae7e066bc301faeecfbd519c4743849 (diff) | |
download | sandhi-c85fe5cb75d32544eb89a573e8df61757a940766.tar.gz sandhi-c85fe5cb75d32544eb89a573e8df61757a940766.tar.bz2 sandhi-c85fe5cb75d32544eb89a573e8df61757a940766.zip |
gras: code cleanup and comments from last commit
Diffstat (limited to 'python/gras')
-rw-r--r-- | python/gras/GRAS_Block.i | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/python/gras/GRAS_Block.i b/python/gras/GRAS_Block.i index e18476a..9cd96e2 100644 --- a/python/gras/GRAS_Block.i +++ b/python/gras/GRAS_Block.i @@ -122,11 +122,10 @@ struct BlockPython : Block this->reset(); } - void _Py_set_ref(PyObject *o) - { - std::cout << o->ob_refcnt <<std::endl; - this->weak_self.reset(new WeakElementPyObject(o)); - } + void _Py_init_weak_ref__(PyObject *o) + { + this->weak_self.reset(new WeakElementPyObject(o)); + } void notify_active(void) { @@ -242,10 +241,10 @@ def sig_to_dtype_sig(sig): class Block(BlockPython): def __init__(self, name='Block', in_sig=None, out_sig=None): BlockPython.__init__(self, name) + self._Py_init_weak_ref__(self) self.set_input_signature(in_sig) self.set_output_signature(out_sig) - self.__prop_registry = dict(); - self._Py_set_ref(self) + self.__prop_registry = dict() def set_input_signature(self, sig): self.__in_sig = sig_to_dtype_sig(sig) |