diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-09-11 22:24:30 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-09-11 22:24:30 -0400 |
commit | d40d745cba1de0df4ada7d4d2cf9f1632279ae12 (patch) | |
tree | 2043992934a0a68f35eb31e231c3dca1908fa04a /indra | |
parent | 8e0128c493bce16555b3a9132bd71b670c322d63 (diff) |
DEV-38598, QAR-1619: Ensure we remove LLFloaterTOS from LLFloaterReg registry.
LLFloater's destructor calls LLFloaterReg::removeInstance() with its own name
and key. But for the new LLFloaterTOS invocation, we pass a key that's an LLSD
map. removeInstance() critically depends on LLFloater::KeyCompare::equate() --
but equate() never considered a non-scalar LLSD key value. Fortunately
llsdutil.h already provides a deep-equality function for LLSD: llsd_equals().
Making equate() trivially call llsd_equals() fixes the crash on TOS cancel.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llfloater.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index ca3829e1bd..786340b468 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -60,6 +60,7 @@ #include "v2math.h" #include "lltrans.h" #include "llmultifloater.h" +#include "llsdutil.h" // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; @@ -175,29 +176,7 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b) { - if (a.type() != b.type()) - { - //llerrs << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << llendl; - return false; - } - else if (a.isUndefined()) - return true; - else if (a.isInteger()) - return a.asInteger() == b.asInteger(); - else if (a.isReal()) - return a.asReal() == b.asReal(); - else if (a.isString()) - return a.asString() == b.asString(); - else if (a.isUUID()) - return a.asUUID() == b.asUUID(); - else if (a.isDate()) - return a.asDate() == b.asDate(); - else if (a.isURI()) - return a.asString() == b.asString(); // compare URIs as strings - else if (a.isBoolean()) - return a.asBoolean() == b.asBoolean(); - else - return false; // no valid operation for Binary + return llsd_equals(a, b); } //************************************ |