diff options
Diffstat (limited to 'src/env.cc')
-rw-r--r-- | src/env.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/env.cc b/src/env.cc index 4b05a8b4a9..afdebc304f 100644 --- a/src/env.cc +++ b/src/env.cc @@ -276,6 +276,11 @@ Environment::~Environment() { TRACE_EVENT_NESTABLE_ASYNC_END0( TRACING_CATEGORY_NODE1(environment), "Environment", this); + + // Dereference all addons that were loaded into this environment. + for (binding::DLib& addon : loaded_addons_) { + addon.Close(); + } } void Environment::Start(const std::vector<std::string>& args, |