dbus/mono ProxyBuilder.cs,1.5.2.4,1.5.2.5

Joe Shaw joe at freedesktop.org
Tue Mar 15 15:30:12 PST 2005


Update of /cvs/dbus/dbus/mono
In directory gabe:/tmp/cvs-serv9899/mono

Modified Files:
      Tag: dbus-0-23
	ProxyBuilder.cs 
Log Message:
2005-03-15  Joe Shaw  <joeshaw at novell.com>

	* mono/ProxyBuilder.cs (BuildFinalizer): Fix some invalid IL when
	generating the finalizer.  Fixes from Ben Maurer.

Index: ProxyBuilder.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/ProxyBuilder.cs,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -u -d -r1.5.2.4 -r1.5.2.5
--- ProxyBuilder.cs	13 Mar 2005 05:06:14 -0000	1.5.2.4
+++ ProxyBuilder.cs	15 Mar 2005 23:30:10 -0000	1.5.2.5
@@ -468,7 +468,7 @@
       generator.Emit(OpCodes.Ret);
     }
     
-    public void BuildFinalizer (TypeBuilder tb, FieldInfo fi)
+    public void BuildFinalizer (TypeBuilder tb, FieldInfo serviceF, FieldInfo deleF)
     {
        // Note that this is a *HORRIBLE* example of how to build a finalizer
        // It doesn't use the try/finally to chain to Object::Finalize. However,
@@ -485,8 +485,10 @@
 
        //generator.EmitWriteLine("this.service.SignalCalled -= this.delegate_created");
        generator.Emit (OpCodes.Ldarg_0);
-       generator.Emit (OpCodes.Ldfld, fi);
-       generator.Emit (OpCodes.Call, Service_RemoveSignalCalledMI);
+       generator.Emit (OpCodes.Ldfld, serviceF);
+       generator.Emit (OpCodes.Ldarg_0);
+       generator.Emit (OpCodes.Ldfld, deleF);
+       generator.EmitCall (OpCodes.Callvirt, Service_RemoveSignalCalledMI, null);
        generator.Emit (OpCodes.Ret);
     }
     
@@ -556,7 +558,7 @@
 	FieldBuilder deleF = typeB.DefineField("delegate_created", 
 					       typeof(Service.SignalCalledHandler), 
 					       FieldAttributes.Private);
-	BuildFinalizer (typeB, deleF);
+	BuildFinalizer (typeB, serviceF, deleF);
 	
 	MethodInfo signalCalledMI = BuildSignalCalled(ref typeB, serviceF, pathF);
 	BuildConstructor(ref typeB, serviceF, pathF, signalCalledMI, deleF);



More information about the dbus-commit mailing list