[Gridflow-cvs] [svn] commit: r3340 - /trunk/base/main.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Mar 28 16:55:03 EDT 2008


Author: matju
Date: Fri Mar 28 16:55:03 2008
New Revision: 3340

Log:
really delete C++ objects immediately when corresponding Pd objects are deleted.

Modified:
    trunk/base/main.c

Modified: trunk/base/main.c
==============================================================================
--- trunk/base/main.c (original)
+++ trunk/base/main.c Fri Mar 28 16:55:03 2008
@@ -124,7 +124,7 @@
 }
 
 //----------------------------------------------------------------
-\class FObject < CObject
+\class FObject : CObject
 
 static void FObject_prepare_message(int &argc, Ruby *&argv, Ruby &sym, FObject *foo=0) {
 	if (argc<1) {
@@ -288,8 +288,9 @@
 }
 
 \def void delete_m () {
-	Ruby keep = rb_ivar_get(mGridFlow, SI(@fobjects));
-	rb_funcall(keep,SI(delete),1,rself);
+	rb_funcall(rb_ivar_get(mGridFlow, SI(@fobjects)),SI(delete),1,rself);
+	DATA_PTR(rself) = 0; // really!
+	delete this; // really!
 }
 
 \classinfo
@@ -319,7 +320,7 @@
 }
 
 /* **************************************************************** */
-\class BitPacking < CObject
+\class BitPacking : CObject
 
 \def void initialize(Ruby foo1, Ruby foo2, Ruby foo3) {}
 



More information about the Gridflow-cvs mailing list