Squashed commit of the following:
commit
6946763e813ab16584b977647cf8c3b7fce5e434
Author: Oleksii Shumeiko <oshumeik@cisco.com>
Date: Tue Dec 22 13:42:38 2020 +0200
managers: clean all inactive inspectors ignoring referenced ones
At the exit the framework guarantees all inactive inspectors will be cleaned up.
}
}
-#if 0
-static void dump_refs(PHList& trash)
+static void purge_trash(const PHList& trash)
{
for ( auto* p : trash )
- {
- if ( !p->is_inactive() )
- printf("%s = %u\n", p->get_api()->base.name, p->get_ref(0));
- }
+ if ( p->is_inactive() )
+ InspectorManager::free_inspector(p);
+ else
+ LogMessage("Still-referenced inspector found in the trash: '%s'.\n",
+ p->get_api()->base.name);
}
-#endif
-
void InspectorManager::release_plugins()
{
- empty_trash();
-
-#if 0
- dump_refs(s_trash);
- dump_refs(s_trash2);
-#endif
+ purge_trash(s_trash);
+ purge_trash(s_trash2);
for ( auto* p : s_handlers )
{