diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index de8dcd4f6..3663bb6cb 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3019,17 +3019,7 @@ void pass_processObjectPropertiesFamily(LLMessageSystem *msg, void**) void process_script_running_reply(LLMessageSystem* msg, void** v) { LLLiveLSLEditor::processScriptRunningReply(msg, v); - if (ScriptCounter::sCheckMap.size()) - { - LLUUID item_id; - msg->getUUIDFast(_PREHASH_Script, _PREHASH_ItemID, item_id); - std::map::iterator it = ScriptCounter::sCheckMap.find(item_id); - if (it != ScriptCounter::sCheckMap.end()) - { - it->second->processRunningReply(msg); - ScriptCounter::sCheckMap.erase(it); - } - } + ScriptCounter::processScriptRunningReply(msg); } void register_viewer_callbacks(LLMessageSystem* msg) diff --git a/indra/newview/scriptcounter.cpp b/indra/newview/scriptcounter.cpp index 2004e8cff..9e25512df 100644 --- a/indra/newview/scriptcounter.cpp +++ b/indra/newview/scriptcounter.cpp @@ -165,6 +165,21 @@ void ScriptCounter::inventoryChanged(LLViewerObject* obj, LLInventoryObject::obj summarize(); } +void ScriptCounter::processScriptRunningReply(LLMessageSystem* msg) +{ + if (!sCheckMap.empty()) + { + LLUUID item_id; + msg->getUUIDFast(_PREHASH_Script, _PREHASH_ItemID, item_id); + auto it = sCheckMap.find(item_id); + if (it != sCheckMap.end()) + { + it->second->processRunningReply(msg); + sCheckMap.erase(it); + } + } +} + void ScriptCounter::processRunningReply(LLMessageSystem* msg) { BOOL is; diff --git a/indra/newview/scriptcounter.h b/indra/newview/scriptcounter.h index 78fd32058..90dedfbb0 100644 --- a/indra/newview/scriptcounter.h +++ b/indra/newview/scriptcounter.h @@ -33,19 +33,19 @@ #include "llvoinventorylistener.h" -class ScriptCounter : public LLInstanceTracker, public LLVOInventoryListener +class ScriptCounter final : public LLInstanceTracker, public LLVOInventoryListener { public: ScriptCounter(bool do_delete, LLViewerObject* object); ~ScriptCounter(); - /*virtual*/ void inventoryChanged(LLViewerObject* obj, LLInventoryObject::object_list_t* inv, S32, void*); + void inventoryChanged(LLViewerObject* obj, LLInventoryObject::object_list_t* inv, S32, void*) override; void requestInventories(); + static void processScriptRunningReply(LLMessageSystem* msg); private: void requestInventoriesFor(LLViewerObject* object); void requestInventoryFor(LLViewerObject* object); - friend void process_script_running_reply(LLMessageSystem* msg, void**); void processRunningReply(LLMessageSystem* msg); void summarize(); // Check if finished, if so, output and destroy.