easly1989 / ffxiv_act_dfassist

Duty Finder Assist Plugin for ACT, Based on https://github.com/devunt/DFAssist
GNU General Public License v3.0
83 stars 37 forks source link

Update aborts its own update thread while updating... #40

Closed EQAditu closed 5 years ago

EQAditu commented 5 years ago

Steps:

  1. Enable 2.1.7
  2. Restart ACT
  3. Accept update prompt to 2.1.8

Observed: Plugin stops and remains unchecked. ACT's error log contains:

***** 2019-11-07T13:54:28 - Plugin Update Check
System.Threading.ThreadAbortException: Thread was being aborted.
   at System.Threading.WaitHandle.WaitOneNative(SafeHandle waitableSafeHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
   at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
   at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)
   at System.Windows.Forms.Control.WaitForWaitHandle(WaitHandle waitHandle)
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at Advanced_Combat_Tracker.ThreadInvokes.CheckboxSetChecked(Form parent, CheckBox target, Boolean isChecked)
   at DFAssist.Helpers.ACTPluginUpdateHelper.FormActMain_UpdateCheckClicked()
   at Advanced_Combat_Tracker.FormActMain.WriteExceptionLog(Exception ex, String MoreInfo)
   at DFAssist.Helpers.ACTPluginUpdateHelper.FormActMain_UpdateCheckClicked()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
*****

The FFXIV plugin actually had this exact problem before, so it was easy to identify. Your plugin deinit method will dispose objects and part of your disposing will abort owned threads.

My suggestion is to make the thread a background thread and avoid aborting it like this.

easly1989 commented 5 years ago

Gonna fix it asap!

easly1989 commented 5 years ago

from 2.2.0 it should be as you suggested If it works for you, please close the issue, otherwise let me know! (:

EQAditu commented 5 years ago

Going from 2.2.0 to 2.2.1 seemed to work fine.