From 3cddb0df2ec7bbf0b3f94ef36609697820a96582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Wed, 1 Jan 2020 21:35:07 -0500 Subject: [PATCH] Fix Crashes 1 and 5: LLTextEditor::replaceUrl, call to member When a boost bind is converted into a suitable slot_function_type, trackables will no longer be tracked, thus using ternary or static casts breaks tracking, so old text editors were still receiving signals. --- indra/llui/lltexteditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index a796cdc99..b78051a5e 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -4228,8 +4228,9 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s if (always_underline) link_style->mUnderline = true; appendAndHighlightText(link, part, link_style, !always_underline/*match.underlineOnHoverOnly()*/); }; - const auto&& cb = force_replace_links ? static_cast(boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3)) : LLUrlRegistryNullCallback; - while (!text.empty() && LLUrlRegistry::instance().findUrl(text, match, cb)) + const auto&& cb = boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3); + auto& urlr = LLUrlRegistry::instance(); + while (!text.empty() && (force_replace_links ? urlr.findUrl(text, match, cb) : urlr.findUrl(text, match))) { start = match.getStart(); end = match.getEnd()+1;