diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 312926978..56a2e7b85 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -29,17 +29,17 @@ #include "llinventorytype.h" #include "llinventorydefines.h" -static LLTranslationBridge* sTrans = NULL; +static LLTranslationBridge::ptr_t sTrans = NULL; // static -void LLWearableType::initClass(LLTranslationBridge* trans) +void LLWearableType::initClass(LLTranslationBridge::ptr_t &trans) { sTrans = trans; } void LLWearableType::cleanupClass() { - delete sTrans; + sTrans.reset(); } struct WearableEntry : public LLDictionaryEntry diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index 41e5a1ba6..a7887fa9a 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -63,7 +63,7 @@ public: WT_NONE = -1, }; - static void initClass(LLTranslationBridge* trans); // initializes static members + static void initClass(LLTranslationBridge::ptr_t &trans); // initializes static members static void cleanupClass(); // initializes static members static const std::string& getTypeName(EType type); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a10b6a6e3..13c769e7e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -640,7 +640,8 @@ bool LLAppViewer::init() // initialize LLWearableType translation bridge. // Memory will be cleaned up in ::cleanupClass() - LLWearableType::initClass(new LLUITranslationBridge()); + LLTranslationBridge::ptr_t trans = std::make_shared(); + LLWearableType::initClass(trans); // // We can call this early.