Server
- 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:
parent
2a674dbae7
commit
d94834a121
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue