mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 11:36:51 +01:00
Forgot to release a semaphore lock.
This commit is contained in:
parent
e666d17dc2
commit
73005e032b
@ -98,6 +98,7 @@ class PacketProcessingQueue extends AbstractConcurrentListenerMultimap<AsyncList
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// No more queued packets.
|
// No more queued packets.
|
||||||
|
signalProcessingDone();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ public final class PacketFilterManager implements ProtocolManager {
|
|||||||
private SortedPacketListenerList sendingListeners = new SortedPacketListenerList();
|
private SortedPacketListenerList sendingListeners = new SortedPacketListenerList();
|
||||||
|
|
||||||
// Whether or not this class has been closed
|
// Whether or not this class has been closed
|
||||||
private boolean hasClosed;
|
private volatile boolean hasClosed;
|
||||||
|
|
||||||
// The default class loader
|
// The default class loader
|
||||||
private ClassLoader classLoader;
|
private ClassLoader classLoader;
|
||||||
@ -700,23 +700,26 @@ public final class PacketFilterManager implements ProtocolManager {
|
|||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
// Guard
|
// Guard
|
||||||
if (hasClosed)
|
if (hasClosed || playerInjection == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Remove everything
|
// Remove everything
|
||||||
for (PlayerInjector injection : playerInjection.values()) {
|
for (PlayerInjector injection : playerInjection.values()) {
|
||||||
injection.cleanupAll();
|
if (injection != null) {
|
||||||
|
injection.cleanupAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove packet handlers
|
// Remove packet handlers
|
||||||
if (packetInjector != null)
|
if (packetInjector != null)
|
||||||
packetInjector.cleanupAll();
|
packetInjector.cleanupAll();
|
||||||
|
|
||||||
|
hasClosed = true;
|
||||||
|
|
||||||
// Remove listeners
|
// Remove listeners
|
||||||
packetListeners.clear();
|
packetListeners.clear();
|
||||||
playerInjection.clear();
|
playerInjection.clear();
|
||||||
connectionLookup.clear();
|
connectionLookup.clear();
|
||||||
hasClosed = true;
|
|
||||||
|
|
||||||
// Clean up async handlers. We have to do this last.
|
// Clean up async handlers. We have to do this last.
|
||||||
asyncFilterManager.cleanupAll();
|
asyncFilterManager.cleanupAll();
|
||||||
|
Loading…
Reference in New Issue
Block a user