mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-02 10:43:31 +00:00
Fixed module null references on shutdown
This commit is contained in:
parent
2d9a656dde
commit
4c766f29b4
@ -51,7 +51,10 @@ namespace Artemis.Managers
|
||||
ProfilePreviewModel == null)
|
||||
return;
|
||||
|
||||
lock (GameViewModels)
|
||||
{
|
||||
var activePreview = GameViewModels.FirstOrDefault(vm => vm.IsActive);
|
||||
|
||||
if (activePreview == null)
|
||||
{
|
||||
// Should not be active if no selected profile is set
|
||||
@ -67,7 +70,8 @@ namespace Artemis.Managers
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_effectManager.ActiveEffect != ProfilePreviewModel && !(_effectManager.ActiveEffect is GameModel))
|
||||
if (_effectManager.ActiveEffect != ProfilePreviewModel &&
|
||||
!(_effectManager.ActiveEffect is GameModel))
|
||||
{
|
||||
_logger.Debug("Activate profile preview");
|
||||
_effectManager.ChangeEffect(ProfilePreviewModel);
|
||||
@ -82,4 +86,5 @@ namespace Artemis.Managers
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -39,7 +39,7 @@ namespace Artemis.Modules.Games.GtaV
|
||||
// Delay restoring the DLL to allow GTA to release it
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
Thread.Sleep(2000);
|
||||
Thread.Sleep(5000);
|
||||
DllManager.RestoreLogitechDll();
|
||||
});
|
||||
|
||||
@ -59,17 +59,17 @@ namespace Artemis.Modules.Games.GtaV
|
||||
|
||||
private void PipeServerOnPipeMessage(string reply)
|
||||
{
|
||||
if (!Initialized)
|
||||
return;
|
||||
|
||||
// Convert the given string to a list of ints
|
||||
var stringParts = reply.Split(' ');
|
||||
var parts = new string[stringParts.Length];
|
||||
for (var i = 0; i < stringParts.Length; i++)
|
||||
parts[i] = stringParts[i];
|
||||
|
||||
if (parts[0] == "0")
|
||||
InterpertrateLighting(parts);
|
||||
// if (!Initialized)
|
||||
// return;
|
||||
//
|
||||
// // Convert the given string to a list of ints
|
||||
// var stringParts = reply.Split(' ');
|
||||
// var parts = new string[stringParts.Length];
|
||||
// for (var i = 0; i < stringParts.Length; i++)
|
||||
// parts[i] = stringParts[i];
|
||||
//
|
||||
// if (parts[0] == "0")
|
||||
// InterpertrateLighting(parts);
|
||||
}
|
||||
|
||||
private void InterpertrateLighting(string[] parts)
|
||||
|
||||
@ -88,9 +88,9 @@ namespace Artemis.Modules.Games.Overwatch
|
||||
{
|
||||
Initialized = false;
|
||||
|
||||
_stickyStatus.Dispose();
|
||||
_stickyUltimateReady.Dispose();
|
||||
_stickyUltimateUsed.Dispose();
|
||||
_stickyStatus?.Dispose();
|
||||
_stickyUltimateReady?.Dispose();
|
||||
_stickyUltimateUsed?.Dispose();
|
||||
|
||||
_pipeServer.PipeMessage -= PipeServerOnPipeMessage;
|
||||
base.Dispose();
|
||||
|
||||
@ -40,8 +40,8 @@ namespace Artemis.Modules.Games.TheDivision
|
||||
DllManager.RestoreLogitechDll();
|
||||
});
|
||||
|
||||
_stickyAmmo.Dispose();
|
||||
_stickyHp.Dispose();
|
||||
_stickyAmmo?.Dispose();
|
||||
_stickyHp?.Dispose();
|
||||
|
||||
_pipeServer.PipeMessage -= PipeServerOnPipeMessage;
|
||||
base.Dispose();
|
||||
|
||||
@ -70,7 +70,7 @@ namespace Artemis.Modules.Games.WoW
|
||||
{
|
||||
Initialized = false;
|
||||
|
||||
_process.Dispose();
|
||||
_process?.Dispose();
|
||||
_process = null;
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
@ -62,7 +62,6 @@ namespace Artemis.Utilities.GameState
|
||||
|
||||
private void ListenerRun()
|
||||
{
|
||||
// TODO: Check for UI issue
|
||||
while (Running)
|
||||
{
|
||||
_listener.BeginGetContext(HandleRequest, _listener);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user