[Kde-bindings] playground/bindings/kimono

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Mar 22 20:58:50 UTC 2007


SVN commit 645537 by rdale:

* The above problem is caused by the GCHandle leak preventing premature
  garbage collection, and once the leak problem was fixed it exposed
  Qyoto's problems with coordinatign C#'s GC with Qt memory management
  via QObject trees etc.
* Qyoto method calls can now return null values

CCMAIL: kde-bindings at kde.org



 M  +5 -0      ChangeLog  
 M  +14 -6     SmokeInvocation.cs  


--- trunk/playground/bindings/kimono/ChangeLog #645536:645537
@@ -4,6 +4,11 @@
 	* Freed GCHandles in a few places, but there are still a lot of leaks
 	* Hmm, a fix for a GCHandle leak stopped custom slots from working for
 	  no apparent reason.
+	* The above problem is caused by the GCHandle leak preventing premature
+	  garbage collection, and once the leak problem was fixed it exposed
+	  Qyoto's problems with coordinatign C#'s GC with Qt memory management
+	  via QObject trees etc.
+	* Qyoto method calls can now return null values
 
 2007-03-21  Arno Rehn  <arno at arnorehn.de>
 
--- trunk/playground/bindings/kimono/SmokeInvocation.cs #645536:645537
@@ -531,19 +531,27 @@
 					} else if (returnType == typeof(double)) {
 						returnValue.ReturnValue = stack[0].s_double;
 					} else if (returnType == typeof(string)) {
-						returnValue.ReturnValue = ((GCHandle) stack[0].s_class).Target;
+						if (((IntPtr) stack[0].s_class) == (IntPtr) 0) {
+							returnValue.ReturnValue = null;
+						} else {
+							returnValue.ReturnValue = ((GCHandle) stack[0].s_class).Target;
 #if DEBUG
-						DebugGCHandle.Free((GCHandle) stack[0].s_class);
+							DebugGCHandle.Free((GCHandle) stack[0].s_class);
 #else
-						((GCHandle) stack[0].s_class).Free();
+							((GCHandle) stack[0].s_class).Free();
 #endif
+						}
 					} else {
-						returnValue.ReturnValue = ((GCHandle) stack[0].s_class).Target;
+						if (((IntPtr) stack[0].s_class) == (IntPtr) 0) {
+							returnValue.ReturnValue = null;
+						} else {
+							returnValue.ReturnValue = ((GCHandle) stack[0].s_class).Target;
 #if DEBUG
-						DebugGCHandle.Free((GCHandle) stack[0].s_class);
+							DebugGCHandle.Free((GCHandle) stack[0].s_class);
 #else
-						((GCHandle) stack[0].s_class).Free();
+							((GCHandle) stack[0].s_class).Free();
 #endif
+						}
 					}
 				}
 			}



More information about the Kde-bindings mailing list