Fixed possible race condition on resource cleanup.

This commit is contained in:
Armin Novak 2017-10-23 09:48:52 +02:00
parent e7884aec26
commit b355616527

View File

@ -376,6 +376,10 @@ public class LibFreeRDP {
private static void OnConnectionFailure(long inst) {
if (listener != null)
listener.OnConnectionFailure(inst);
synchronized (mInstanceState) {
mInstanceState.remove(inst);
mInstanceState.notifyAll();
}
}
private static void OnPreConnect(long inst) {
@ -386,15 +390,15 @@ public class LibFreeRDP {
private static void OnDisconnecting(long inst) {
if (listener != null)
listener.OnDisconnecting(inst);
synchronized (mInstanceState) {
mInstanceState.remove(inst);
mInstanceState.notifyAll();
}
}
private static void OnDisconnected(long inst) {
if (listener != null)
listener.OnDisconnected(inst);
synchronized (mInstanceState) {
mInstanceState.remove(inst);
mInstanceState.notifyAll();
}
}
private static void OnSettingsChanged(long inst, int width, int height, int bpp) {