Author: toshok
Date: 2006-08-28 13:27:08 -0400 (Mon, 28 Aug 2006)
New Revision: 64482
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs
Log:
* Form.cs: remove unused "active_form" static field.
* Hwnd.cs: lock around accesses to static windows collection.
* Application.cs: lock threads in Exit ().
2006-08-28 Chris Toshok <[EMAIL PROTECTED]>
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
2006-08-28 17:16:00 UTC (rev 64481)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
2006-08-28 17:27:08 UTC (rev 64482)
@@ -135,7 +135,9 @@
Application.ApplicationExit(null, EventArgs.Empty);
}
}
- threads[thread_id] = null;
+ lock (threads) {
+ threads[thread_id] = null;
+ }
}
#endregion // Methods
}
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-08-28 17:16:00 UTC (rev 64481)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-08-28 17:27:08 UTC (rev 64482)
@@ -1,5 +1,13 @@
2006-08-28 Chris Toshok <[EMAIL PROTECTED]>
+ * Form.cs: remove unused "active_form" static field.
+
+ * Hwnd.cs: lock around accesses to static windows collection.
+
+ * Application.cs: lock threads in Exit ().
+
+2006-08-28 Chris Toshok <[EMAIL PROTECTED]>
+
* NativeWindow.cs: lock around accesses to window_collection.
2006-08-28 Chris Toshok <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2006-08-28 17:16:00 UTC (rev 64481)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2006-08-28 17:27:08 UTC (rev 64482)
@@ -42,7 +42,6 @@
[ToolboxItem(false)]
public class Form : ContainerControl {
#region Local Variables
- internal static Form active_form;
internal bool closing;
FormBorderStyle form_border_style;
private bool autoscale;
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs
2006-08-28 17:16:00 UTC (rev 64481)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs
2006-08-28 17:27:08 UTC (rev 64482)
@@ -105,8 +105,10 @@
public void Dispose() {
expose_pending = false;
nc_expose_pending = false;
- windows.Remove(client_window);
- windows.Remove(whole_window);
+ lock (windows) {
+ windows.Remove(client_window);
+ windows.Remove(whole_window);
+ }
for (int i = 0; i < marshal_free_list.Count; i++) {
Marshal.FreeHGlobal((IntPtr)marshal_free_list[i]);
}
@@ -120,12 +122,20 @@
}
public static Hwnd ObjectFromWindow(IntPtr window) {
- return (Hwnd)windows[window];
+ Hwnd rv;
+ lock (windows) {
+ rv = (Hwnd)windows[window];
+ }
+ return rv;
}
public static Hwnd ObjectFromHandle(IntPtr handle) {
//return (Hwnd)(((GCHandle)handle).Target);
- return (Hwnd)windows[handle];
+ Hwnd rv;
+ lock (windows) {
+ rv = (Hwnd)windows[handle];
+ }
+ return rv;
}
public static IntPtr HandleFromObject(Hwnd obj) {
@@ -133,13 +143,19 @@
}
public static Hwnd GetObjectFromWindow(IntPtr window) {
- return (Hwnd)windows[window];
+ Hwnd rv;
+ lock (windows) {
+ rv = (Hwnd)windows[window];
+ }
+ return rv;
}
public static IntPtr GetHandleFromWindow(IntPtr window) {
Hwnd hwnd;
- hwnd = (Hwnd)windows[window];
+ lock (windows) {
+ hwnd = (Hwnd)windows[window];
+ }
if (hwnd != null) {
return hwnd.handle;
} else {
@@ -263,8 +279,10 @@
client_window = value;
handle = value;
- if (windows[client_window] == null) {
- windows[client_window] = this;
+ lock (windows) {
+ if (windows[client_window] == null) {
+ windows[client_window] = this;
+ }
}
}
}
@@ -511,8 +529,10 @@
set {
whole_window = value;
- if (windows[whole_window] == null) {
- windows[whole_window] = this;
+ lock (windows) {
+ if (windows[whole_window] == null) {
+ windows[whole_window] = this;
+ }
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches