Keep upcoming frames when trimming queues
This commit is contained in:
@@ -657,7 +657,7 @@ function trimPendingFrameQueue() {
|
|||||||
const overflow = state.pendingFrames.length - maxQueuedFrames;
|
const overflow = state.pendingFrames.length - maxQueuedFrames;
|
||||||
|
|
||||||
if (overflow > 0) {
|
if (overflow > 0) {
|
||||||
state.pendingFrames.splice(0, overflow);
|
state.pendingFrames.splice(maxQueuedFrames, overflow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -671,7 +671,7 @@ function trimFrameQueue() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const removed = state.frames.splice(0, overflow);
|
const removed = state.frames.splice(maxQueuedFrames, overflow);
|
||||||
|
|
||||||
for (const frame of removed) {
|
for (const frame of removed) {
|
||||||
releaseImage(frame.bitmap);
|
releaseImage(frame.bitmap);
|
||||||
|
|||||||
Reference in New Issue
Block a user