diff options
author | mescalinum <mescalinum@users.sourceforge.net> | 2009-08-28 16:46:43 +0000 |
---|---|---|
committer | mescalinum <mescalinum@users.sourceforge.net> | 2009-08-28 16:46:43 +0000 |
commit | 9545397540a80010def7b2d6028715faf1ec0506 (patch) | |
tree | fe8ad2ad9453eaa2260ea92b8c3da56625db28e7 /tcl.i | |
parent | f2add340c0d41e14398e6728260f7dae424c0ea3 (diff) |
use Tcl reference counters properly -- solved segfaults
svn path=/trunk/externals/tclpd/; revision=12129
Diffstat (limited to 'tcl.i')
-rw-r--r-- | tcl.i | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -133,10 +133,12 @@ int tcl_to_pd(Tcl_Obj *input, t_atom *output) { int pd_to_tcl(t_atom *input, Tcl_Obj **output) { Tcl_Obj* tcl_t_atom[2]; - /*post("pd_to_tcl got an atom of type %d (%s)", +#ifdef DEBUG + post("pd_to_tcl: atom type = %d (%s)", input->a_type, input->a_type == A_FLOAT ? "A_FLOAT" : input->a_type == A_SYMBOL ? "A_SYMBOL" : - input->a_type == A_POINTER ? "A_POINTER" : "?");*/ + input->a_type == A_POINTER ? "A_POINTER" : "?"); +#endif switch (input->a_type) { case A_FLOAT: { tcl_t_atom[0] = Tcl_NewStringObj("float", -1); @@ -159,7 +161,11 @@ int pd_to_tcl(t_atom *input, Tcl_Obj **output) { break; } } +#ifdef DEBUG + post("pd_to_tcl: atom value = \"%s\"", Tcl_GetStringFromObj(tcl_t_atom[1], 0)); +#endif *output = Tcl_NewListObj(2, &tcl_t_atom[0]); + Tcl_IncrRefCount(*output); return TCL_OK; } |