aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index ddcf926d..8bff19fa 100644
--- a/src/library.js
+++ b/src/library.js
@@ -5102,7 +5102,9 @@ LibraryManager.library = {
} else {
var lib_record = DLFCN_DATA.loadedLibs[handle];
if (--lib_record.refcount == 0) {
- lib_record.module.cleanups.forEach(function(cleanup) { cleanup() });
+ if (lib_record.module.cleanups) {
+ lib_record.module.cleanups.forEach(function(cleanup) { cleanup() });
+ }
delete DLFCN_DATA.loadedLibNames[lib_record.name];
delete DLFCN_DATA.loadedLibs[handle];
}