Author Topic: [v1.7.3.3] VoiceAttack logs an exception when restarted too quickly  (Read 1580 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
This is an old one, has been a thing on my machine going back many, many versions:

When VoiceAttack is closing, if a new instance is started before the previous one has fully stopped, nothing will appear to happen(I.E. VoiceAttack remains closed)

However, usually(though not always) after that happens this will be logged to VoiceAttackFault.txt(with a time/date stamp):
Code: [Select]
System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
   at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
   at System.Threading.WaitHandle.WaitOne(TimeSpan timeout, Boolean exitContext)
   at VoiceAttack.Program.(String[] )

When VoiceAttack is started afterward, there will not be "VoiceAttack Shutdown Issue" dialog shown.


This doesn't cause any other issues as far as I'm aware, but it does mean that quickly restarting VoiceAttack while testing can be difficult.

On my machine the VoiceAttack.exe process takes about ±3 seconds to disappear from task manager, which is plenty of time to double-click a shortcut to launch a new instance.


Ideally the new instance would detect that the running instance is shutting down, and wait until then before loading any files(as they would potentially still be in use) and starting the GUI, though I don't know if that's feasible to implement.


EDIT: The exception appears to be handled gracefully in v1.8.3.22
« Last Edit: March 07, 2020, 11:01:57 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.7.3.3] VoiceAttack logs an exception when restarted too quickly
« Reply #1 on: March 06, 2020, 11:14:16 PM »
I've put better handling on that exception.  Not terribly much I can do about detecting if an instance is shutting down outside of messaging.  On my machine, I'm now able to kill one instance and then load another in decent amount of time without incident (probably due to the better handling of that exception lol).