mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 19:54:59 +00:00
Removes explicit call to dispose when program stops. Clears queue in dispose
This commit is contained in:
@@ -150,13 +150,13 @@ namespace PepperDash.Essentials.Core.Queues
|
|||||||
_delayEnabled = pacing > 0;
|
_delayEnabled = pacing > 0;
|
||||||
_delayTime = pacing;
|
_delayTime = pacing;
|
||||||
|
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
//CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
||||||
{
|
//{
|
||||||
if (programEvent != eProgramStatusEventType.Stopping)
|
// if (programEvent != eProgramStatusEventType.Stopping)
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
Dispose(true);
|
// Dispose(true);
|
||||||
};
|
//};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -231,6 +231,8 @@ namespace PepperDash.Essentials.Core.Queues
|
|||||||
|
|
||||||
if (disposing)
|
if (disposing)
|
||||||
{
|
{
|
||||||
|
Debug.Console(2, this, "Disposing...");
|
||||||
|
_queue.Clear();
|
||||||
Enqueue(null);
|
Enqueue(null);
|
||||||
_worker.Join();
|
_worker.Join();
|
||||||
_waitHandle.Close();
|
_waitHandle.Close();
|
||||||
@@ -402,13 +404,13 @@ namespace PepperDash_Essentials_Core.Queues
|
|||||||
_delayEnabled = pacing > 0;
|
_delayEnabled = pacing > 0;
|
||||||
_delayTime = pacing;
|
_delayTime = pacing;
|
||||||
|
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
//CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
||||||
{
|
//{
|
||||||
if (programEvent != eProgramStatusEventType.Stopping)
|
// if (programEvent != eProgramStatusEventType.Stopping)
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
Dispose(true);
|
// Dispose(true);
|
||||||
};
|
//};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -477,6 +479,8 @@ namespace PepperDash_Essentials_Core.Queues
|
|||||||
|
|
||||||
if (disposing)
|
if (disposing)
|
||||||
{
|
{
|
||||||
|
Debug.Console(2, this, "Disposing...");
|
||||||
|
_queue.Clear();
|
||||||
Enqueue(null);
|
Enqueue(null);
|
||||||
_worker.Join();
|
_worker.Join();
|
||||||
_waitHandle.Close();
|
_waitHandle.Close();
|
||||||
|
|||||||
Reference in New Issue
Block a user