[49325] trunk/base/src/tclobjc1.0

toby at macports.org toby at macports.org
Tue Apr 7 09:01:36 PDT 2009


Revision: 49325
          http://trac.macports.org/changeset/49325
Author:   toby at macports.org
Date:     2009-04-07 09:01:29 -0700 (Tue, 07 Apr 2009)
Log Message:
-----------
legacy support, untested

Modified Paths:
--------------
    trunk/base/src/tclobjc1.0/objc_encoding.m
    trunk/base/src/tclobjc1.0/tclobjc_types.m

Modified: trunk/base/src/tclobjc1.0/objc_encoding.m
===================================================================
--- trunk/base/src/tclobjc1.0/objc_encoding.m	2009-04-07 15:53:08 UTC (rev 49324)
+++ trunk/base/src/tclobjc1.0/objc_encoding.m	2009-04-07 16:01:29 UTC (rev 49325)
@@ -47,6 +47,10 @@
 #include "objc_encoding.h"
 #include "tclobjc_types.h"
 
+#ifndef _C_ULNG_LNG
+#define _C_ULNG_LNG 'Q'
+#endif
+
 int objc_to_tclobj(Tcl_Interp *interp, Tcl_Obj **objPtr, const char *type, void *val) {
 	char *name;
 

Modified: trunk/base/src/tclobjc1.0/tclobjc_types.m
===================================================================
--- trunk/base/src/tclobjc1.0/tclobjc_types.m	2009-04-07 15:53:08 UTC (rev 49324)
+++ trunk/base/src/tclobjc1.0/tclobjc_types.m	2009-04-07 16:01:29 UTC (rev 49325)
@@ -82,13 +82,20 @@
  * Release the internal objective-c instance.
  */
 static void free_objc_internalrep(Tcl_Obj *objPtr UNUSED) {
-    /* TODO cleanup */
+	id objcId = objPtr->internalRep.otherValuePtr;
+	if (Tcl_IsShared(objPtr)) {
+		NSLog(@"shared  %@ %p", [objcId class], objcId);
+		return;
+	}
+	NSLog(@"release %@ %p", [objcId class], objcId);
+	[objcId release];
 }
 
 /**
  * Duplicate the internal objective-c pointer.
  */
 static void dup_objc_internalrep(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr) {
+	printf("dup_objc_internalrep: %p\n", srcPtr->internalRep.otherValuePtr);
 	dupPtr->internalRep.otherValuePtr = srcPtr->internalRep.otherValuePtr;
 }
 
@@ -144,6 +151,7 @@
 		oldTypePtr->freeIntRepProc(objPtr);
 	}
 
+	printf("set_objc_fromstring: %p\n", (void *)objcId);
 	objPtr->internalRep.otherValuePtr = objcId;
 	objPtr->typePtr = &tclObjcIdType;
 
@@ -174,6 +182,7 @@
 
 	objPtr->bytes = NULL;
 
+	NSLog(@"retain  %@ %p", [objcId class], objcId);
 	objPtr->internalRep.otherValuePtr = [objcId retain]; /* this is a leak */
 	objPtr->typePtr = &tclObjcIdType;
 	return (objPtr);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090407/d7e77ff2/attachment.html>


More information about the macports-changes mailing list