summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcommandmanager.cpp2
-rw-r--r--indra/llui/llnotifications.cpp32
-rw-r--r--indra/llui/llnotifications.h2
3 files changed, 34 insertions, 2 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 03717da80b..b10ec51f18 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -170,12 +170,14 @@ bool LLCommandManager::load()
if (!parser.readXUI(commands_file, commandsParams))
{
+ LLError::LLUserWarningMsg::showMissingFiles();
LL_ERRS() << "Unable to load xml file: " << commands_file << LL_ENDL;
return false;
}
if (!commandsParams.validateBlock())
{
+ LLError::LLUserWarningMsg::showMissingFiles();
LL_ERRS() << "Invalid commands file: " << commands_file << LL_ENDL;
return false;
}
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 6fc9b90fb8..a05feab1d9 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -614,6 +614,13 @@ void LLNotification::cancel()
LLSD LLNotification::getResponseTemplate(EResponseTemplateType type)
{
LLSD response = LLSD::emptyMap();
+
+ if (!mForm)
+ {
+ LL_WARNS("Notifications") << "Null form when getting response template for notification " << getName() << LL_ENDL;
+ return response;
+ }
+
for (S32 element_idx = 0;
element_idx < mForm->getNumElements();
++element_idx)
@@ -1249,10 +1256,26 @@ LLNotifications::LLNotifications()
LLInstanceTracker<LLNotificationChannel, std::string>::instanceCount();
}
+
+LLNotifications::~LLNotifications()
+{
+ // Clear explicitly, something in ~LLNotifications() crashes so narrowing down suspects
+ pHistoryChannel = nullptr;
+ pExpirationChannel = nullptr;
+ mGlobalStrings.clear();
+ mTemplates.clear();
+ mVisibilityRules.clear();
+ mUniqueNotifications.clear();
+ mListener = nullptr;
+}
+
void LLNotifications::clear()
{
mDefaultChannels.clear();
- mTemplates.clear();
+ // At this point mTemplates still gets used by lingering notifications
+ // to do responses (ex: group notice will call forceResponse()), but
+ // since network should be down and everything save, it's questionable
+ // whether it should stay that way
}
// The expiration channel gets all notifications that are cancelled
@@ -1465,6 +1488,13 @@ bool LLNotifications::templateExists(std::string_view name)
void LLNotifications::forceResponse(const LLNotification::Params& params, S32 option)
{
LLNotificationPtr temp_notify(new LLNotification(params));
+
+ if (!temp_notify->getForm())
+ {
+ LL_WARNS("Notifications") << "Cannot force response for notification with null form: " << (std::string)params.name << LL_ENDL;
+ return;
+ }
+
LLSD response = temp_notify->getResponseTemplate();
LLSD selected_item = temp_notify->getForm()->getElement(option);
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 46286457cf..138f1969d5 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -887,7 +887,7 @@ class LLNotifications :
{
LLSINGLETON(LLNotifications);
LOG_CLASS(LLNotifications);
- virtual ~LLNotifications() {}
+ virtual ~LLNotifications();
public: