Skip to content

Commit

Permalink
fix: catch early err postMessage to cvworker
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-liang committed Oct 10, 2022
1 parent 2e1ee53 commit 31cea9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/systems/armarker/camera-capture/ccarheadset.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ export class ARHeadsetCameraCapture {
};

// post frame data, marking the pixel buffer as transferable
this.cvWorker.postMessage(camFrameMsg, [camFrameMsg.grayscalePixels.buffer]);
try {
this.cvWorker.postMessage(camFrameMsg, [camFrameMsg.grayscalePixels.buffer]);
} catch (err) {
console.warn('Failed to post message to CV Worker', err);
}
}

/**
Expand Down

0 comments on commit 31cea9d

Please sign in to comment.