Przeglądaj źródła

2004-01-19 Zoltan Varga <[email protected]>

	* Module.cs: Decrease the image reference count when the Module is
	garbage collected.

svn path=/trunk/mcs/; revision=22265
Zoltan Varga 22 lat temu
rodzic
commit
a5dbe020cd

+ 5 - 0
mcs/class/corlib/System.Reflection/ChangeLog

@@ -1,3 +1,8 @@
+2004-01-19  Zoltan Varga  <[email protected]>
+
+	* Module.cs: Decrease the image reference count when the Module is
+	garbage collected.
+
 2004-01-16  Martin Baulig  <[email protected]>
 
 	* Assembly.cs: Make the `MonoDebugger_' methods static.

+ 8 - 1
mcs/class/corlib/System.Reflection/Module.cs

@@ -29,7 +29,11 @@ namespace System.Reflection {
 		internal string scopename;
 		internal bool is_resource;
 	
-		internal Module () {}
+		internal Module () { }
+
+		~Module () {
+			Close ();
+		}
 	
 		public Assembly Assembly {
 			get { return assembly; }
@@ -200,5 +204,8 @@ namespace System.Reflection {
 
 		[MethodImplAttribute (MethodImplOptions.InternalCall)]
 		private extern Type GetGlobalType ();
+
+		[MethodImplAttribute (MethodImplOptions.InternalCall)]
+		private extern void Close ();
 	}
 }