[Mono-bugs] [Bug 77146][Nor] Changed - DynamicMethods leak memory

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jun 12 13:01:46 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by vargaz at gmail.com.


--- shadow/77146	2007-06-12 11:02:39.000000000 -0400
+++ shadow/77146.tmp.31112	2007-06-12 13:01:46.000000000 -0400
@@ -53,6 +53,13 @@
 ------- Additional Comments From robertj at gmx.net  2007-06-12 11:02 -------
 Zoltan, the delegate created by DynamicMethod.CreateDelegate() is
 actually stored in the DynamicMethod instance. They will be collected
 together, isn't it? Or do I miss something?
+------- Additional Comments From vargaz at gmail.com  2007-06-12 13:01 -------
+No, it is possible for the DynamicMethod to become collected, while the
+delegate lives on since the caller of CreateDelegate still keeps a 
+reference on it. The mono_runtime_free_method () needs to be called when
+the delegate dies, not when the DynamicMethod dies.

More information about the mono-bugs mailing list