Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

on-exit-leak-free

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

on-exit-leak-free - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

16

index.js

@@ -11,4 +11,11 @@ 'use strict'

}
const registry = new FinalizationRegistry(clear)
let registry
function ensureRegistry () {
if (registry === undefined) {
registry = new FinalizationRegistry(clear)
}
}
function install (event) {

@@ -27,2 +34,5 @@ if (refs[event].length > 0) {

process.removeListener(event, functions[event])
if (refs.exit.length === 0 && refs.beforeExit.length === 0) {
registry = undefined
}
}

@@ -69,2 +79,3 @@

ensureRegistry()
registry.register(obj, ref)

@@ -83,2 +94,5 @@ refs[event].push(ref)

function unregister (obj) {
if (registry === undefined) {
return
}
registry.unregister(obj)

@@ -85,0 +99,0 @@ for (const event of ['exit', 'beforeExit']) {

2

package.json
{
"name": "on-exit-leak-free",
"version": "2.1.1",
"version": "2.1.2",
"description": "Execute a function on exit without leaking memory, allowing all objects to be garbage collected",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -14,3 +14,2 @@ 'use strict'

function shutdown (obj, event) {
console.log(event)
shutdownCalled = true

@@ -17,0 +16,0 @@ if (event === 'beforeExit') {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc