mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-15 20:54:46 +00:00
# PDC-5 AddQueueToGenericUdpServer
- Removed the Finally statement. Using finally caused a null refence exception for the CCriticalSection object at shutdown.
This commit is contained in:
@@ -222,24 +222,24 @@ namespace PepperDash.Core
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
// Pull from Queue and fire an event. Block indefinitely until an item can be removed, similar to a Gather.
|
// Pull from Queue and fire an event. Block indefinitely until an item can be removed, similar to a Gather.
|
||||||
var message = MessageQueue.Dequeue();
|
var message = MessageQueue.Dequeue();
|
||||||
var dataRecivedExtra = DataRecievedExtra;
|
var dataRecivedExtra = DataRecievedExtra;
|
||||||
if (dataRecivedExtra != null)
|
if (dataRecivedExtra != null)
|
||||||
{
|
{
|
||||||
dataRecivedExtra(this, message);
|
dataRecivedExtra(this, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "GenericUdpServer DequeueEvent error: {0}\r", e);
|
Debug.Console(0, "GenericUdpServer DequeueEvent error: {0}\r", e);
|
||||||
}
|
}
|
||||||
finally
|
// Make sure to leave the CCritical section in case an exception above stops this thread, or we won't be able to restart it.
|
||||||
|
if (DequeueLock != null)
|
||||||
{
|
{
|
||||||
// Make sure to leave the CCritical section in case an exception above stops this thread, or we won't be able to restart it.
|
|
||||||
DequeueLock.Leave();
|
DequeueLock.Leave();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user