]> git.codecow.com Git - nano25519.git/commitdiff
Clean up existing worker blob if it already exists before creating anew.
authorChris Duncan <chris@zoso.dev>
Fri, 14 Aug 2026 05:01:14 +0000 (22:01 -0700)
committerChris Duncan <chris@zoso.dev>
Fri, 14 Aug 2026 05:01:14 +0000 (22:01 -0700)
src/lib/worker.ts

index dea84e40109cf64db0d175acca7375ae4872d5b6..644f7d3c5020b2e8743a25495f90d903ef4a55f1 100644 (file)
@@ -127,6 +127,7 @@ function isBytes (a: unknown): a is Uint8Array<ArrayBuffer> {
 function init (): void {
        try {
                BROWSER: {
+                       if (url) URL.revokeObjectURL(url)
                        url = URL.createObjectURL(new Blob([nano25519_worker], { type: 'text/javascript' }))
                        worker = new Worker(url, { type: 'module' })
                }