@lvce-editor/renderer-process 30.69.0 → 30.69.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rendererProcessMain.js +11 -1
- package/package.json +1 -1
|
@@ -10797,9 +10797,17 @@ const createCanvasPresentation = (canvas, onDispose) => {
|
|
|
10797
10797
|
if (disposed) return;
|
|
10798
10798
|
disposed = true;
|
|
10799
10799
|
port1.onmessage = null;
|
|
10800
|
+
port1.onmessageerror = null;
|
|
10800
10801
|
port1.close();
|
|
10801
10802
|
onDispose();
|
|
10802
10803
|
};
|
|
10804
|
+
port1.onmessageerror = () => {
|
|
10805
|
+
// Firefox can reject a transferred bitmap while decoding the message.
|
|
10806
|
+
// Release the sender's single frame slot so the next frame can recover.
|
|
10807
|
+
if (!disposed) port1.postMessage({
|
|
10808
|
+
type: 'presented'
|
|
10809
|
+
});
|
|
10810
|
+
};
|
|
10803
10811
|
port1.onmessage = event => {
|
|
10804
10812
|
const {
|
|
10805
10813
|
bitmap,
|
|
@@ -10881,10 +10889,12 @@ const createForPreview = async (canvasId, objectId, portId, width, height) => {
|
|
|
10881
10889
|
canvas.dataset.id = String(canvasId);
|
|
10882
10890
|
const offscreen = new OffscreenCanvas(width, height);
|
|
10883
10891
|
const presentation = createCanvasPresentation(canvas, () => set$c(canvasId, undefined));
|
|
10892
|
+
// Keep the receiving port reachable until the sandbox disposes this canvas.
|
|
10884
10893
|
set$c(canvasId, {
|
|
10885
10894
|
factory: {},
|
|
10886
10895
|
state: {
|
|
10887
|
-
$Viewlet: canvas
|
|
10896
|
+
$Viewlet: canvas,
|
|
10897
|
+
canvasPresentation: presentation
|
|
10888
10898
|
}
|
|
10889
10899
|
});
|
|
10890
10900
|
try {
|