GrogHeads Forum

Grog Friends and Affiliates => General Staff Support Forum => Army Editor Tech Support => Topic started by: zu Pferd on December 24, 2018, 04:02:40 PM

Title: crash detected deleting unit
Post by: zu Pferd on December 24, 2018, 04:02:40 PM
Hello,

I just experienced a repetitious crash event while trying to delete units from army file.
There is no detailed error message but the generic Windows message that the program has stopped working....

premature report....it appear's if I pick "renumber ID's" in the pull down menu the crash does not happen
and I can delete

disregard

Thanks
Title: Re: crash detected deleting unit
Post by: Mickey3D on January 01, 2019, 01:35:26 PM
I had a similar problem some times ago but then it was fixed: http://grogheads.com/forums/index.php?topic=22829.0 (http://grogheads.com/forums/index.php?topic=22829.0)

But I have done a test today and indeed the problem is back. Error message in the windows event log (sorry, French version):
QuoteApplication : GSBPArmyEditor.exe
Version du Framework : v4.0.30319
Description : le processus a été arrêté en raison d'une exception non gérée.
Informations sur l'exception : System.InvalidOperationException
   à System.Linq.Enumerable.SingleOrDefault[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   à ArmyEditor.MainWindowViewModel.<get_DeleteCommand>b__61_0(ArmyEditor.UnitVM)

Informations sur l'exception : System.Reflection.TargetInvocationException
   à System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
   à System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
   à System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   à GalaSoft.MvvmLight.Helpers.WeakAction`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Execute(System.__Canon)
   à GalaSoft.MvvmLight.CommandWpf.RelayCommand`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Execute(System.Object)
   à MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource, Boolean)
   à System.Windows.Controls.Primitives.ButtonBase.OnClick()
   à System.Windows.Controls.Button.OnClick()
   à System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
   à System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   à System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   à System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   à System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
   à System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
   à System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   à System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   à System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   à System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   à System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
   à System.Windows.Input.InputManager.ProcessStagingArea()
   à System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
   à System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
   à System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
   à System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
   à System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   à MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   à MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   à System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   à System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   à MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   à System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   à System.Windows.Application.RunDispatcher(System.Object)
   à System.Windows.Application.RunInternal(System.Windows.Window)
   à ArmyEditor.App.Main()

Version: 0.2018.09.05
Build date: 30 Oct 2018

Title: Re: crash detected deleting unit
Post by: Mickey3D on January 01, 2019, 01:45:51 PM
Renumbering IDs is solving the problem for me.
Title: Re: crash detected deleting unit
Post by: Andy ONeill on January 01, 2019, 04:17:38 PM
You should be able to delete, no problem.

Just took a look at this.
The seasons festivities mean I'm not totally sober right now.
But I can't reproduce this issue with the current version of code I have.
I found a different problem with the save file name, which I've fixed and pushed the changes.
That will be delivered the next time Ezra puts a copy of the installer on the server.

I'll take another look tomorrow.

Maybe an old version of one of the libraries was distributed somehow.

The background to that "old" bug:

The unit structure you see units represented in for the treeview relies on the xml file structure.
A unit has a collection of subordinates which in turn has a collection of subordinates and so on.
When you delete it needs to go find the parent unit in order to take your unit out it's list of subordinates.
This is done by taking the CO Id property and taking a look for a unit with a matching ID.
When that wasn't set or two match then bad things happen.

You could open an xml file using internet explorer ( or an xml editor ) and check the IDs of one of your files are OK.
Or
Just click the renumber button and it'll redo the ids.
Since you don't have the scenario editor yet, the specific ID of a unit doesn't matter so much so long as they are consistent within the hierarchy.
When we eventually distribute the scenario editor then it'll matter... But we'll hopefully have worked out what's happening and fixed anything needs fixing by then.

Title: Re: crash detected deleting unit
Post by: zu Pferd on January 06, 2019, 06:20:16 PM
Holidays aside ...not quite recovered yet either, I thank you for the reply
Cheers

Title: Re: crash detected deleting unit
Post by: Andy ONeill on January 07, 2019, 11:20:00 AM
Just to confirm.

The current version does a good impression of working fine for me.
I've added, deleted, saved, re-opened pasted etc.
Everything I can think of.
I couldn't find the problem.


Not that this is a 100% guarantee there's not a bug lurking there somehow.
I just can't find it if there is.
Title: Re: crash detected deleting unit
Post by: Mickey3D on January 08, 2019, 03:58:21 PM
Quote from: Mickey3D on January 01, 2019, 01:35:26 PM
But I have done a test today and indeed the problem is back.

Actually I think there was a problem because I used an old army file. Starting with a new army, deletion is working.
Title: Re: crash detected deleting unit
Post by: Andy ONeill on January 09, 2019, 08:58:59 AM
That would explain it then.

There definitely was a bug at one time.
AFAIK I fixed that and new units will get ID set.
That doesn't fix old files.
You'd need to renumber any old army file that you created with the bugged version.