Author: spouliot
Date: 2006-09-22 20:22:13 -0400 (Fri, 22 Sep 2006)
New Revision: 65830
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs
Log:
2006-09-22 Sebastien Pouliot <[EMAIL PROTECTED]>
* SystemInformation.cs: Return a clone of the theme's MenuFont because
anyone can dispose it, anytime. All other properties returns enums,
structs or basic types so they don't need such tricks.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-09-23 00:04:54 UTC (rev 65829)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-09-23 00:22:13 UTC (rev 65830)
@@ -1,3 +1,9 @@
+2006-09-22 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * SystemInformation.cs: Return a clone of the theme's MenuFont because
+ anyone can dispose it, anytime. All other properties returns enums,
+ structs or basic types so they don't need such tricks.
+
2006-09-22 Jackson Harper <[EMAIL PROTECTED]>
* XplatUI.cs:
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs
2006-09-23 00:04:54 UTC (rev 65829)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs
2006-09-23 00:22:13 UTC (rev 65830)
@@ -17,7 +17,7 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004 Novell, Inc.
+// Copyright (c) 2004,2006 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Miguel de Icaza ([EMAIL PROTECTED]).
@@ -201,7 +201,10 @@
public static Font MenuFont {
get {
- return ThemeEngine.Current.MenuFont;
+ // note: we MUST return a clone of the Font
instance as anyone
+ // can dispose it. However we shouldn't expect
the theme to do
+ // the cloning for performance reason
+ return (Font)
ThemeEngine.Current.MenuFont.Clone ();
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches