I am using Swig (1.3.27) to create, use, and delete C++
objects from TCL.
set newobj [new_MyClass]
set result [MyClass_DoSomething $newobj]
I put the code above in a TCL loop to do some testing and discovered
something that I don’t understand. If I run the code above in a
loop, the TCL shell crashes after several loops. Now, if I change the
last line to…
…then I don’t get the crash. If a
C++ object is created from TCL, do I have to use the “$newobj –delete”
way of garbage collecting it? I don’t understand why there is
a difference between “delete_MyObject $newobj” and “$newobj –delete”.