Skip to content

Commit 08ecce1

Browse files
Merge pull request #667 from TheTrackerCouncil/reset-snes-connector
Force resetting of snes connector on restarting tracker
2 parents 81b206b + 349e5b3 commit 08ecce1

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

src/TrackerCouncil.Smz3.Abstractions/TrackerBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace TrackerCouncil.Smz3.Abstractions;
1010

11-
public abstract class TrackerBase
11+
public abstract class TrackerBase : IDisposable
1212
{
1313
/// <summary>
1414
/// Occurs when any speech was recognized, regardless of configured
@@ -369,4 +369,6 @@ protected virtual void OnVoiceRecognitionEnabledChanged()
369369
{
370370
VoiceRecognitionEnabledChanged?.Invoke(this, EventArgs.Empty);
371371
}
372+
373+
public abstract void Dispose();
372374
}

src/TrackerCouncil.Smz3.Tracking/AutoTracking/AutoTracker.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public AutoTracker(ILogger<AutoTracker> logger,
5353
_config = randomizerConfigService;
5454
TrackerBase = trackerBase;
5555
_snesConnectorService = snesConnectorService;
56+
_snesConnectorService.ClearRequests();
5657

5758
foreach (var module in modules)
5859
{

src/TrackerCouncil.Smz3.Tracking/Tracker.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ public override void Error()
596596
/// <summary>
597597
/// Cleans up resources used by this class.
598598
/// </summary>
599-
public void Dispose()
599+
public override void Dispose()
600600
{
601601
Dispose(disposing: true);
602602
GC.SuppressFinalize(this);
@@ -664,6 +664,7 @@ private void Dispose(bool disposing)
664664
{
665665
(_recognizer as IDisposable)?.Dispose();
666666
(_communicator as IDisposable)?.Dispose();
667+
_moduleFactory.Dispose();
667668

668669
foreach (var timer in _idleTimers.Values)
669670
timer.Dispose();

src/TrackerCouncil.Smz3.UI/Services/TrackerWindowService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ public async Task Shutdown()
340340
_trackerMapWindow?.Close();
341341
_trackerLocationsWindow?.Close();
342342
tracker.StopTracking();
343+
tracker.Dispose();
343344
_dispatcherTimer.Stop();
344345
_window.Close();
345346
}

0 commit comments

Comments
 (0)