We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A new web worker is made every time scan is called but the old workers are never closed or terminated.
We probably want to call terminate as documented here: https://developer.mozilla.org/en-US/docs/Web/API/Worker/terminate
The following screenshot is from Google Chrome Developer Tools "Source" tab after scanning multiple images with nude.js:
Related to #1
The text was updated successfully, but these errors were encountered:
I added myWorker.terminate() to the onmessage callback to fix the problem for me: ``
scanImage = function(){ // get the image data var image = ctx.getImageData(0, 0, canvas.width, canvas.height), imageData = image.data; var myWorker = new Worker('/lib/nudejs/worker.nude.js'), message = [imageData, canvas.width, canvas.height]; myWorker.postMessage(message); myWorker.onmessage = function(event){ resultHandler(event.data); myWorker.terminate(); } },
Sorry but I don't have time to clone the repository and create a pull request.
Sorry, something went wrong.
No branches or pull requests
A new web worker is made every time scan is called but the old workers are never closed or terminated.
We probably want to call terminate as documented here:
https://developer.mozilla.org/en-US/docs/Web/API/Worker/terminate
The following screenshot is from Google Chrome Developer Tools "Source" tab after scanning multiple images with nude.js:
Related to #1
The text was updated successfully, but these errors were encountered: