diff --git a/core/logic/HandleSys.cpp b/core/logic/HandleSys.cpp index dbfea4f5..5ef76c15 100644 --- a/core/logic/HandleSys.cpp +++ b/core/logic/HandleSys.cpp @@ -35,6 +35,7 @@ #include "common_logic.h" #include "ShareSys.h" #include "ExtensionSys.h" +#include "PluginSys.h" HandleSystem g_HandleSys; @@ -981,12 +982,11 @@ bool HandleSystem::InitAccessDefaults(TypeAccess *pTypeAccess, HandleAccess *pHa bool HandleSystem::TryAndFreeSomeHandles() { - IPluginIterator *pl_iter = scripts->GetPluginIterator(); IPlugin *highest_owner = NULL; unsigned int highest_handle_count = 0; /* Search all plugins */ - while (pl_iter->MorePlugins()) + for (IPluginIterator *pl_iter = g_PluginSys.GetPluginIterator(); pl_iter->MorePlugins(); pl_iter->NextPlugin()) { IPlugin *plugin = pl_iter->GetPlugin(); IdentityToken_t *identity = plugin->GetIdentity(); @@ -1015,8 +1015,6 @@ bool HandleSystem::TryAndFreeSomeHandles() highest_owner = plugin; highest_handle_count = handle_count; } - - pl_iter->NextPlugin(); } if (highest_owner == NULL || highest_handle_count == 0)