- Fixed bug in `addListener(Listener)` whereby the `scope`'d code would never run on exception unwinding as it never appeared before such a `throw` clause
This commit is contained in:
Tristan B. Velloza Kildaire 2023-03-27 23:26:35 +02:00
parent 2a674dbae7
commit d94834a121
1 changed files with 7 additions and 7 deletions

View File

@ -43,6 +43,13 @@ public class Server
/* Lock the listener queue */
listenerQLock.lock();
/* On return or exception */
scope(exit)
{
/* Unlock the listener queue */
listenerQLock.unlock();
}
/* If the listener has NOT added */
if(canFind(listenerQ[], newListener))
{
@ -55,13 +62,6 @@ public class Server
/* Throw an exception */
throw new RenaissanceException(ErrorType.LISTENER_ALREADY_ADDED);
}
/* On return or exception */
scope(exit)
{
/* Unlock the listener queue */
listenerQLock.unlock();
}
}
/**