Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#288 closed defect (released)

WarFoundry WinForms assumes that army tree will be open

Reported by: ibboard Owned by: ibboard
Priority: trivial Milestone: WarFoundry 0.1
Component: General/Unknown Version: WarFoundry 0.1b9
Keywords: disposed Cc:
Blocked By: Blocking:

Description

When testing #276 I found that creating a new army after closing the Army Tree causes a crash:

System.ObjectDisposedException: The object was used after being disposed.
  at System.Windows.Forms.Control.CreateHandle () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Form.CreateHandle () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.CreateControl () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.SetVisibleCore (Boolean value) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.Show () [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:Show ()
  at IBBoard.WarFoundry.GUI.WinForms.FrmMain.SetNonNullArmyState (IBBoard.WarFoundry.API.Objects.Army newArmy) [0x00000] in <filename unknown>:0 
  at IBBoard.WarFoundry.GUI.WinForms.FrmMain.SetArmy (IBBoard.WarFoundry.API.Objects.Army newArmy) [0x00000] in <filename unknown>:0 
  at IBBoard.WarFoundry.GUI.WinForms.FrmMain.set_CurrentArmy (IBBoard.WarFoundry.API.Objects.Army value) [0x00000] in <filename unknown>:0 
  at IBBoard.WarFoundry.GUI.WinForms.FrmMain.CreateNewArmy () [0x00000] in <filename unknown>:0 
  at IBBoard.WarFoundry.GUI.WinForms.FrmMain.miNewArmy_Click (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ToolStripItem.OnClick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ToolStripMenuItem.OnClick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ToolStripMenuItem.HandleClick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ToolStripItem.FireEvent (System.EventArgs e, ToolStripItemEventType met) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.ToolStripItem:FireEvent (System.EventArgs,System.Windows.Forms.ToolStripItemEventType)
  at System.Windows.Forms.ToolStrip.OnMouseUp (System.Windows.Forms.MouseEventArgs mea) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ToolStripDropDown.OnMouseUp (System.Windows.Forms.MouseEventArgs mea) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ToolStrip.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ToolStripDropDown.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0 

Change History (3)

comment:1 Changed 10 years ago by ibboard

Owner: set to ibboard
Status: newaccepted

comment:2 Changed 10 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

(In r580) Fixes #288: WarFoundry WinForms assumes that army tree will be open

  • Add a getter method that returns a new army tree if the old one was disposed or non exists
  • Unhook the army tree from the army changed events on dispose

comment:3 Changed 9 years ago by ibboard

Resolution: fixedreleased

Retro-actively tag RC1 releases as released

Note: See TracTickets for help on using tickets.