private WeakReference<BufferStrategy> strategy;
@Override
public synchronized boolean checkAllowed(BufferStrategy bs) {
if (strategy != null) {
BufferStrategy current = strategy.get();
if (current != null) {
return (current == bs);
}
}
strategy = new WeakReference<BufferStrategy>(bs);