From b813b2e8e9c94a8adf0d2db2a1dd01f4bfa70652 Mon Sep 17 00:00:00 2001 From: CihatAltiparmak Date: Sat, 7 Dec 2024 23:33:51 +0300 Subject: [PATCH] Took into account of the reference of unmanaged instances --- include/class_loader/class_loader.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/class_loader/class_loader.hpp b/include/class_loader/class_loader.hpp index b0af5b6..86c6fb1 100644 --- a/include/class_loader/class_loader.hpp +++ b/include/class_loader/class_loader.hpp @@ -327,10 +327,8 @@ class ClassLoader Base * obj = class_loader::impl::createInstance(derived_class_name, this); assert(obj != NULL); // Unreachable assertion if createInstance() throws on failure. - if (managed) { - std::lock_guard lock(plugin_ref_count_mutex_); - ++plugin_ref_count_; - } + std::lock_guard lock(plugin_ref_count_mutex_); + ++plugin_ref_count_; return obj; }