Now able to switch screens away from party without crashing
This commit is contained in:
@ -181,18 +181,24 @@ namespace Aurora.Services.EventManager
|
||||
if (actionsCopy.ContainsKey(pair.Key))
|
||||
{
|
||||
actionsCopy.TryGetValue(pair.Key, out Action<BaseEvent> action);
|
||||
Task executionTask = new Task(() => action(bEvent));
|
||||
executionTask.ContinueWith((Task task) => ExceptionHandler(task, pair.Key),
|
||||
TaskContinuationOptions.OnlyOnFaulted);
|
||||
|
||||
ParameterizedThreadStart operation = new ParameterizedThreadStart(obj => action((BaseEvent)obj));
|
||||
Thread executionThread = new Thread(operation, 1024 * 1024);
|
||||
|
||||
executionThread.Start(bEvent);
|
||||
executionThread.Join();
|
||||
executionTask.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ExceptionHandler(Task executionTask, string actionKey)
|
||||
{
|
||||
var exception = executionTask.Exception;
|
||||
Console.WriteLine(string.Format("SERVER --- Exception occurred firing event"));
|
||||
this._actionList.Remove(actionKey);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user