mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 00:19:46 +01:00
Update helpers.js to include .dlete
This commit is contained in:
parent
8dc4ad3ff3
commit
3dec85df71
|
|
@ -397,3 +397,16 @@ Module['matFromImageData'] = function(imageData) {
|
|||
mat.data.set(imageData.data);
|
||||
return mat;
|
||||
};
|
||||
// Add Symbol.dispose support for using declaration in TypeScript 5.2+ and future JS
|
||||
if (
|
||||
typeof Symbol !== "undefined" &&
|
||||
Symbol.dispose &&
|
||||
typeof cv !== "undefined" &&
|
||||
cv.Mat &&
|
||||
typeof cv.Mat.prototype.delete === "function"
|
||||
) {
|
||||
cv.Mat.prototype[Symbol.dispose] = cv.Mat.prototype.delete;
|
||||
// Optionally repeat for other types that require manual cleanup:
|
||||
if (cv.UMat) cv.UMat.prototype[Symbol.dispose] = cv.UMat.prototype.delete;
|
||||
// Add more as OpenCV gains new manual-cleanup classes
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user