[Mono-bugs] [Bug 81669][Wis] Changed - Icon..ctor(String filename) needs Write access to the file
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri May 18 08:20:06 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 sebastien at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=81669
--- shadow/81669 2007-05-18 08:13:01.000000000 -0400
+++ shadow/81669.tmp.17742 2007-05-18 08:20:05.000000000 -0400
@@ -1,22 +1,21 @@
Bug#: 81669
Product: Mono: Class Libraries
Version: 1.2
OS: unknown
OS Details: XP SP2
-Status: NEW
+Status: NEEDINFO
Resolution:
Severity: Unknown
Priority: Wishlist
Component: Sys.Drawing.
AssignedTo: mono-bugs at ximian.com
ReportedBy: andyhume32 at yahoo.co.uk
QAContact: mono-bugs at ximian.com
TargetMilestone: ---
URL:
-Cc:
Summary: Icon..ctor(String filename) needs Write access to the file
Icon..ctor(String filename) needs Write access to the file
Mono 1.2.4. (installer). Tested only on Windows XP SP2, where it always
occurs.
@@ -50,6 +49,38 @@
------- Additional Comments From everaldo at simios.org 2007-05-18 08:09 -------
Can you attach the icon that you are using?
------- Additional Comments From everaldo at simios.org 2007-05-18 08:13 -------
Looks like it happens with any icon, forget about attach icon :)
+
+------- Additional Comments From sebastien at ximian.com 2007-05-18 08:20 -------
+Thanks!
+Icon.cs fixed in SVN r77632.
+
+c.c. Igor for Icon2.jvm.cs
+
+c.c. Toshok for cursor (patch inline)
+
+note: we can dispose the stream (hence the using pattern) because the
+stream will not be used, under win32, by MS GDI+.
+
+
+Index: System.Windows.Forms/Cursor.cs
+===================================================================
+--- System.Windows.Forms/Cursor.cs (revision 77551)
++++ System.Windows.Forms/Cursor.cs (working copy)
+@@ -144,7 +144,11 @@
+ CreateCursor(stream);
+ }
+
+- public Cursor(string fileName) : this (new FileStream
+(fileName, FileMode.Open)) {
++ public Cursor (string fileName)
++ {
++ using (FileStream fs = File.Open (fileName)) {
++ CreateCursor (fs);
++ }
+ }
+
+ public Cursor(Type type, string resource) {
+
More information about the mono-bugs
mailing list