[Mono-bugs] [Bug 79343][Cri] New - Crash while leaving a menu.
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sat Sep 9 02:58:51 EDT 2006
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 miguel at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=79343
--- shadow/79343 2006-09-09 02:58:51.000000000 -0400
+++ shadow/79343.tmp.27536 2006-09-09 02:58:51.000000000 -0400
@@ -0,0 +1,79 @@
+Bug#: 79343
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Critical
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com
+ReportedBy: miguel at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Crash while leaving a menu.
+
+Run:
+
+winforms/mainmenu/swf-mainmenu.exe
+
+1. Click and hold on the menu, for example in the word "Standard"
+2. Move the pointer away from the window, but keep the button held down.
+3. Release the button.
+
+it fails like this:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+ at System.Windows.Forms.MenuTracker.OnMouseUp
+(System.Windows.Forms.MouseEventArgs args) [0x00000] in
+/home/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs:171
+ at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message& m)
+[0x0065b] in
+/home/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:1917
+ at System.Windows.Forms.Control+ControlNativeWindow.WndProc
+(System.Windows.Forms.Message& m) [0x00000] in
+/home/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:162
+ at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg,
+IntPtr wParam, IntPtr lParam) [0x0006b] in
+/home/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:159
+ at System.Windows.Forms.XplatUIX11.DispatchMessage
+(System.Windows.Forms.MSG& msg) [0x00000] in
+/home/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:2718
+ at System.Windows.Forms.XplatUI.DispatchMessage
+(System.Windows.Forms.MSG& msg) [0x00000] in
+/home/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:427
+ at System.Windows.Forms.Application.RunLoop (Boolean Modal,
+System.Windows.Forms.ApplicationContext context) [0x0023c] in
+/home/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:523
+ at System.Windows.Forms.Application.Run (System.Windows.Forms.Form
+mainForm) [0x00000] in
+/home/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:417
+ at MyFormProject.MainForm.Main (System.String[] args) [0x00000]
+
+The stack trace seems busted for the first method, as thats the entry point
+
+
+I think the issue is that item is null, proposed patch:
+
+Index: System.Windows.Forms/MenuAPI.cs
+===================================================================
+--- System.Windows.Forms/MenuAPI.cs (revision 65142)
++++ System.Windows.Forms/MenuAPI.cs (working copy)
+@@ -169,11 +169,12 @@
+ public void OnMouseUp (MouseEventArgs args)
+ {
+ MenuItem item = GetItemAtXY (args.X, args.Y);
+- if (item.Parent is MainMenu)
++ if (item != null && item.Parent is MainMenu)
+ return;
+
+ Deactivate ();
+- item.PerformClick ();
++ if (item != null)
++ item.PerformClick ();
+ }
+
+ void MoveSelection (MenuItem item)
More information about the mono-bugs
mailing list