add a deque specifically for use with llmessagelogfilter apply to defeat iterator invalidation, replace crlf with lf
This commit is contained in:
@@ -23,6 +23,10 @@ LLFloaterExportRegion::LLFloaterExportRegion(const LLSD& unused)
|
|||||||
{
|
{
|
||||||
sInstance = this;
|
sInstance = this;
|
||||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_export.xml");
|
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_export.xml");
|
||||||
|
|
||||||
|
//populate the list of objects to export
|
||||||
|
//int numOfObjects = gObjectList.getNumObjects();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -412,7 +412,9 @@ LLMessageLogFilterApply::LLMessageLogFilterApply()
|
|||||||
mFinished(FALSE),
|
mFinished(FALSE),
|
||||||
mProgress(0)
|
mProgress(0)
|
||||||
{
|
{
|
||||||
mIter = LLFloaterMessageLog::sMessageLogEntries.begin();
|
//make extra sure we don't invalidate any iterators and reserve a deque exclusively for our use
|
||||||
|
mFilterTempMessages = new std::deque <LLMessageLogEntry>(LLFloaterMessageLog::sMessageLogEntries);
|
||||||
|
mIter = mFilterTempMessages->begin();
|
||||||
}
|
}
|
||||||
void LLMessageLogFilterApply::cancel()
|
void LLMessageLogFilterApply::cancel()
|
||||||
{
|
{
|
||||||
@@ -420,7 +422,7 @@ void LLMessageLogFilterApply::cancel()
|
|||||||
}
|
}
|
||||||
BOOL LLMessageLogFilterApply::tick()
|
BOOL LLMessageLogFilterApply::tick()
|
||||||
{
|
{
|
||||||
std::deque<LLMessageLogEntry>::iterator end = LLFloaterMessageLog::sMessageLogEntries.end();
|
std::deque<LLMessageLogEntry>::iterator end = mFilterTempMessages->end();
|
||||||
if(mIter == end || !LLFloaterMessageLog::sInstance)
|
if(mIter == end || !LLFloaterMessageLog::sInstance)
|
||||||
{
|
{
|
||||||
mFinished = TRUE;
|
mFinished = TRUE;
|
||||||
@@ -445,6 +447,9 @@ BOOL LLMessageLogFilterApply::tick()
|
|||||||
LLFloaterMessageLog::sInstance->stopApplyingFilter();
|
LLFloaterMessageLog::sInstance->stopApplyingFilter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete mFilterTempMessages;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -686,8 +691,10 @@ void LLFloaterMessageLog::onLog(LLMessageLogEntry entry)
|
|||||||
{
|
{
|
||||||
sMessageLogEntries.push_back(entry);
|
sMessageLogEntries.push_back(entry);
|
||||||
if(!sBusyApplyingFilter)
|
if(!sBusyApplyingFilter)
|
||||||
|
{
|
||||||
conditionalLog(LLFloaterMessageLogItem(entry));
|
conditionalLog(LLFloaterMessageLogItem(entry));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// static
|
// static
|
||||||
void LLFloaterMessageLog::conditionalLog(LLFloaterMessageLogItem item)
|
void LLFloaterMessageLog::conditionalLog(LLFloaterMessageLogItem item)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public:
|
|||||||
S32 mProgress;
|
S32 mProgress;
|
||||||
BOOL mFinished;
|
BOOL mFinished;
|
||||||
private:
|
private:
|
||||||
|
std::deque<LLMessageLogEntry> *mFilterTempMessages;
|
||||||
std::deque<LLMessageLogEntry>::iterator mIter;
|
std::deque<LLMessageLogEntry>::iterator mIter;
|
||||||
};
|
};
|
||||||
class LLFloaterMessageLog : public LLFloater, public LLEventTimer
|
class LLFloaterMessageLog : public LLFloater, public LLEventTimer
|
||||||
|
|||||||
Reference in New Issue
Block a user