summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationstorage.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2015-04-09 16:51:02 -0700
committerMerov Linden <merov@lindenlab.com>2015-04-09 16:51:02 -0700
commit8952e8177528fe0eee65916b9e12c3183f15e392 (patch)
tree3625cecb6fd90bf0de23021c22b5d805527af131 /indra/newview/llnotificationstorage.cpp
parent47a3aecc97faa6ecb5267dde4274f0fe417e8409 (diff)
parent6b9b4c91d122dccabf7541af70ed68a623ad8810 (diff)
Merge lindenlab/viewer-tools-update
Diffstat (limited to 'indra/newview/llnotificationstorage.cpp')
-rwxr-xr-xindra/newview/llnotificationstorage.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp
index e9970de58c..315084788e 100755
--- a/indra/newview/llnotificationstorage.cpp
+++ b/indra/newview/llnotificationstorage.cpp
@@ -87,7 +87,7 @@ LLNotificationStorage::~LLNotificationStorage()
bool LLNotificationStorage::writeNotifications(const LLSD& pNotificationData) const
{
- llofstream notifyFile(mFileName.c_str());
+ std::ofstream notifyFile(mFileName.c_str());
bool didFileOpen = notifyFile.is_open();
if (!didFileOpen)
@@ -113,7 +113,7 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData, bool is_n
pNotificationData.clear();
- llifstream notifyFile(filename.c_str());
+ std::ifstream notifyFile(filename.c_str());
didFileRead = notifyFile.is_open();
if (!didFileRead)
{
@@ -123,14 +123,18 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData, bool is_n
{
LLPointer<LLSDParser> parser = new LLSDXMLParser();
didFileRead = (parser->parse(notifyFile, pNotificationData, LLSDSerialize::SIZE_UNLIMITED) >= 0);
+ notifyFile.close();
+
if (!didFileRead)
{
LL_WARNS("LLNotificationStorage") << "Failed to parse open notifications from file '" << mFileName
- << "'" << LL_ENDL;
+ << "'" << LL_ENDL;
+ LLFile::remove(filename);
+ LL_WARNS("LLNotificationStorage") << "Removed invalid open notifications file '" << mFileName
+ << "'" << LL_ENDL;
}
}
-
- LL_INFOS("LLNotificationStorage") << "ending read '" << filename << "'" << LL_ENDL;
+
if (!didFileRead)
{
if(is_new_filename)