[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    [Kde-bindings] playground/bindings/kimono
From:       Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date:       2007-03-22 20:58:50
Message-ID: 1174597130.232530.23262.nullmailer () svn ! kde ! org
[Download RAW message or body]

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@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@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
+						}
 					}
 				}
 			}
_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic