diff options
author | Dessie Linden <dessie@lindenlab.com> | 2010-07-02 07:07:23 -0700 |
---|---|---|
committer | Dessie Linden <dessie@lindenlab.com> | 2010-07-02 07:07:23 -0700 |
commit | 3de5be44adb91d3a7e1ff3ca8b415964a722ce49 (patch) | |
tree | 12a993fde38848529cdcdbadbce2d58cc383d7d2 /indra/llui/lluictrlfactory.cpp | |
parent | 4ffcfe0a5fe21dcb49d79851eb43bd5d80623e0d (diff) | |
parent | 1417bd3985f339915f259bf5971ef21e47e30163 (diff) |
Merged from viewer-release
Diffstat (limited to 'indra/llui/lluictrlfactory.cpp')
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 6b337e0d74..a46d961709 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -452,14 +452,22 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st { // associate parameter block type with template .xml file std::string* existing_tag = LLWidgetNameRegistry::instance().getValue(param_block_type); - if (existing_tag != NULL && *existing_tag != tag) + if (existing_tag != NULL) { - std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; - // forcing crash here - char* foo = 0; - *foo = 1; + if(*existing_tag != tag) + { + std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; + // forcing crash here + char* foo = 0; + *foo = 1; + } + else + { + // widget already registered + return; + } } - LLWidgetNameRegistry ::instance().defaultRegistrar().add(param_block_type, tag); + LLWidgetNameRegistry::instance().defaultRegistrar().add(param_block_type, tag); // associate widget type with factory function LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func); //FIXME: comment this in when working on schema generation |