From e30510bbcad9cbccb389bbafdda7eef761a23231 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 8 Jul 2025 12:39:53 -0400 Subject: [PATCH] MT#63171 AmPlugIn: fix reference counting Increase refcount also for DI plugins and log plugins, as they also have their refcount decreased for unloading. Change-Id: I0b9d2f671a2a1acda4e5210855aafd47f8cb62c3 --- core/AmPlugIn.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/AmPlugIn.cpp b/core/AmPlugIn.cpp index f0e2be39..a28ee35c 100644 --- a/core/AmPlugIn.cpp +++ b/core/AmPlugIn.cpp @@ -584,6 +584,7 @@ int AmPlugIn::loadAppPlugIn(AmPluginFactory* f) return -1; } + inc_ref(sf); name2app.insert(std::make_pair(sf->getName(),sf)); DBG("application '%s' loaded.\n",sf->getName().c_str()); @@ -643,7 +644,8 @@ int AmPlugIn::loadDiPlugIn(AmPluginFactory* f) ERROR("component '%s' already loaded !\n",sf->getName().c_str()); goto error; } - + + inc_ref(sf); name2di.insert(std::make_pair(sf->getName(),sf)); DBG("component '%s' loaded.\n",sf->getName().c_str()); @@ -666,7 +668,8 @@ int AmPlugIn::loadLogFacPlugIn(AmPluginFactory* f) sf->getName().c_str()); goto error; } - + + inc_ref(sf); name2logfac.insert(std::make_pair(sf->getName(),sf)); DBG("logging facility component '%s' loaded.\n",sf->getName().c_str());