mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Ensure we flush iff it is needed
This commit is contained in:
parent
a3f1c71d97
commit
d1312c66e1
@ -415,7 +415,7 @@ public class EditSession implements Extent, AutoCloseable {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!batchingChunks) {
|
if (!batchingChunks && isBatchingChunks()) {
|
||||||
flushSession();
|
flushSession();
|
||||||
}
|
}
|
||||||
chunkBatchingExtent.setEnabled(batchingChunks);
|
chunkBatchingExtent.setEnabled(batchingChunks);
|
||||||
@ -428,9 +428,15 @@ public class EditSession implements Extent, AutoCloseable {
|
|||||||
* @see #setBatchingChunks(boolean)
|
* @see #setBatchingChunks(boolean)
|
||||||
*/
|
*/
|
||||||
public void disableBuffering() {
|
public void disableBuffering() {
|
||||||
// We optimize here to avoid double calls to flushSession.
|
// We optimize here to avoid repeated calls to flushSession.
|
||||||
|
boolean needsFlush = isQueueEnabled() || isBatchingChunks();
|
||||||
|
if (needsFlush) {
|
||||||
|
flushSession();
|
||||||
|
}
|
||||||
reorderExtent.setEnabled(false);
|
reorderExtent.setEnabled(false);
|
||||||
setBatchingChunks(false);
|
if (chunkBatchingExtent != null) {
|
||||||
|
chunkBatchingExtent.setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user