Fix preprocessor memory leak and make string introduced in previous two commits localizable
parent
2673f7cd71
commit
d300a88bcc
|
|
@ -1565,7 +1565,8 @@ void FSLSLPreprocessor::start_process()
|
|||
{
|
||||
LLFloaterCompileQueue::scriptPreprocComplete(mAssetID, mData, mType, output);
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
LLTextEditor* outfield = mCore->mPostEditor;
|
||||
if (outfield)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ private:
|
|||
|
||||
LLFloaterCompileQueue::LLFloaterCompileQueue(const LLSD& key)
|
||||
: LLFloaterScriptQueue(key)
|
||||
, mLSLProc(NULL) // <FS:Ansariel> Script Proprocessor
|
||||
{
|
||||
setTitle(LLTrans::getString("CompileQueueTitle"));
|
||||
setStartString(LLTrans::getString("CompileQueueStart"));
|
||||
|
|
@ -350,7 +351,7 @@ LLFloaterCompileQueue::LLFloaterCompileQueue(const LLSD& key)
|
|||
mUploadQueue = new LLAssetUploadQueue(new LLCompileFloaterUploadQueueSupplier(key.asUUID()));
|
||||
|
||||
// <FS:KC> Script Preprocessor
|
||||
static LLCachedControl<bool> _NACL_LSLPreprocessor(gSavedSettings,"_NACL_LSLPreprocessor", 0);
|
||||
static LLCachedControl<bool> _NACL_LSLPreprocessor(gSavedSettings, "_NACL_LSLPreprocessor");
|
||||
if(_NACL_LSLPreprocessor)
|
||||
{
|
||||
mLSLProc = new FSLSLPreprocessor();
|
||||
|
|
@ -359,7 +360,9 @@ LLFloaterCompileQueue::LLFloaterCompileQueue(const LLSD& key)
|
|||
}
|
||||
|
||||
LLFloaterCompileQueue::~LLFloaterCompileQueue()
|
||||
{
|
||||
{
|
||||
// <FS:Ansariel> Script Proprocessor
|
||||
delete mLSLProc;
|
||||
}
|
||||
|
||||
void LLFloaterCompileQueue::experienceIdsReceived( const LLSD& content )
|
||||
|
|
@ -497,8 +500,8 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
|
|||
if(!url.empty())
|
||||
{
|
||||
// <FS:KC> LSL Preprocessor
|
||||
static LLCachedControl<bool> _NACL_LSLPreprocessor(gSavedSettings,"_NACL_LSLPreprocessor", 0);
|
||||
if(queue->mLSLProc && _NACL_LSLPreprocessor)
|
||||
static LLCachedControl<bool> _NACL_LSLPreprocessor(gSavedSettings, "_NACL_LSLPreprocessor");
|
||||
if (_NACL_LSLPreprocessor && queue->mLSLProc)
|
||||
{
|
||||
U32 script_size = file.getSize();
|
||||
std::string script_data;
|
||||
|
|
@ -507,7 +510,9 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
|
|||
|
||||
script_data = queue->mLSLProc->decode(script_data);
|
||||
|
||||
LLFloaterCompileQueue::scriptLogMessage(data, "Preprocessing: " + data->mItem->getName());
|
||||
LLStringUtil::format_map_t args;
|
||||
args["SCRIPT"] = data->mItem->getName();
|
||||
LLFloaterCompileQueue::scriptLogMessage(data, LLTrans::getString("CompileQueuePreprocessing", args));
|
||||
queue->mLSLProc->preprocess_script(asset_id, data, type, script_data);
|
||||
return;
|
||||
}
|
||||
|
|
@ -567,14 +572,13 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
|
|||
void LLFloaterCompileQueue::scriptPreprocComplete(const LLUUID& asset_id, LLScriptQueueData* data, LLAssetType::EType type, const std::string& script_text)
|
||||
{
|
||||
LL_INFOS() << "LLFloaterCompileQueue::scriptPreprocComplete()" << LL_ENDL;
|
||||
if(!data)
|
||||
if (!data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", data->mQueueID);
|
||||
|
||||
std::string buffer;
|
||||
if(queue)
|
||||
if (queue)
|
||||
{
|
||||
std::string filename;
|
||||
std::string uuid_str;
|
||||
|
|
@ -586,14 +590,16 @@ void LLFloaterCompileQueue::scriptPreprocComplete(const LLUUID& asset_id, LLScri
|
|||
if (object)
|
||||
{
|
||||
std::string url = object->getRegion()->getCapability("UpdateScriptTask");
|
||||
if(!url.empty())
|
||||
if (!url.empty())
|
||||
{
|
||||
// Read script source in to buffer.
|
||||
U32 script_size = script_text.length();
|
||||
U8* script_data = new U8[script_text.length()+1];
|
||||
strcpy((char *)script_data, script_text.c_str());
|
||||
|
||||
LLFloaterCompileQueue::scriptLogMessage(data, "Preprocessing complete of " + data->mItem->getName());
|
||||
LLStringUtil::format_map_t args;
|
||||
args["SCRIPT"] = data->mItem->getName();
|
||||
LLFloaterCompileQueue::scriptLogMessage(data, LLTrans::getString("CompileQueuePreprocessingComplete", args));
|
||||
|
||||
queue->mUploadQueue->queue(filename, data->mTaskId,
|
||||
data->mItem->getUUID(), is_running, queue->mMono, queue->getKey().asUUID(),
|
||||
|
|
@ -601,21 +607,22 @@ void LLFloaterCompileQueue::scriptPreprocComplete(const LLUUID& asset_id, LLScri
|
|||
}
|
||||
else
|
||||
{
|
||||
buffer = LLTrans::getString("CompileQueueServiceUnavailable") + (": ") + data->mItem->getName();
|
||||
LLFloaterCompileQueue::scriptLogMessage(data, LLTrans::getString("CompileQueueServiceUnavailable") + (": ") + data->mItem->getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
delete data;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterCompileQueue::scriptLogMessage(LLScriptQueueData* data, std::string message)
|
||||
{
|
||||
if(!data)
|
||||
if (!data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", data->mQueueID);
|
||||
if(queue)
|
||||
if (queue)
|
||||
{
|
||||
queue->getChild<LLScrollListCtrl>("queue output")->addSimpleElement(message, ADD_BOTTOM);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -455,15 +455,15 @@ LLScriptEdCore::LLScriptEdCore(
|
|||
setBorderVisible(FALSE);
|
||||
|
||||
// NaCl - Script Preprocessor
|
||||
static LLCachedControl<bool> _NACL_LSLPreprocessor(gSavedSettings,"_NACL_LSLPreprocessor", 0);
|
||||
BOOL preproc = _NACL_LSLPreprocessor;
|
||||
if(preproc)
|
||||
if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor"))
|
||||
{
|
||||
setXMLFilename("panel_script_ed_preproc.xml");
|
||||
mLSLProc = new FSLSLPreprocessor(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
setXMLFilename("panel_script_ed.xml");
|
||||
}
|
||||
// NaCl End
|
||||
llassert_always(mContainer != NULL);
|
||||
}
|
||||
|
|
@ -491,6 +491,9 @@ LLScriptEdCore::~LLScriptEdCore()
|
|||
{
|
||||
mSyntaxIDConnection.disconnect();
|
||||
}
|
||||
|
||||
// NaCl - Script Preprocessor
|
||||
delete mLSLProc;
|
||||
}
|
||||
|
||||
void LLLiveLSLEditor::experienceChanged()
|
||||
|
|
@ -849,9 +852,12 @@ void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid)
|
|||
{
|
||||
// NaCl - LSL Preprocessor
|
||||
std::string ntext = text;
|
||||
if(gSavedSettings.getBOOL("_NACL_LSLPreprocessor"))
|
||||
if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor") && mLSLProc)
|
||||
{
|
||||
if(mPostEditor)mPostEditor->setText(ntext);
|
||||
if (mPostEditor)
|
||||
{
|
||||
mPostEditor->setText(ntext);
|
||||
}
|
||||
ntext = mLSLProc->decode(ntext);
|
||||
}
|
||||
LLStringUtil::replaceTabsWithSpaces(ntext, mEditor->spacesPerTab());
|
||||
|
|
@ -864,7 +870,7 @@ void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid)
|
|||
// NaCl - LSL Preprocessor
|
||||
std::string LLScriptEdCore::getScriptText()
|
||||
{
|
||||
if(gSavedSettings.getBOOL("_NACL_LSLPreprocessor") && mPostEditor)
|
||||
if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor") && mPostEditor)
|
||||
{
|
||||
//return mPostEditor->getText();
|
||||
return mPostScript;
|
||||
|
|
@ -1345,7 +1351,7 @@ void LLScriptEdCore::doSave(BOOL close_after_save, bool sync /*= true*/)
|
|||
|
||||
updateIndicators(true, false); //<FS:Kadah> Compile Indicators
|
||||
|
||||
if (mLSLProc && gSavedSettings.getBOOL("_NACL_LSLPreprocessor"))
|
||||
if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor") && mLSLProc)
|
||||
{
|
||||
LL_INFOS() << "passing to preproc" << LL_ENDL;
|
||||
mLSLProc->preprocess_script(close_after_save, sync);
|
||||
|
|
@ -1448,7 +1454,7 @@ void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data)
|
|||
//LL_INFOS() << "LLScriptEdCore::onErrorList() - " << row << ", "
|
||||
//<< column << LL_ENDL;
|
||||
// NaCl - LSL Preprocessor
|
||||
if(gSavedSettings.getBOOL("_NACL_LSLPreprocessor") && self->mPostEditor)
|
||||
if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor") && self->mPostEditor)
|
||||
{
|
||||
LLPanel* tab = self->getChild<LLPanel>("Preprocessed");
|
||||
LLTabContainer* tabset = self->getChild<LLTabContainer>("Tabset");
|
||||
|
|
|
|||
|
|
@ -2175,6 +2175,12 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
|
|||
<string name="CompileQueueStart">
|
||||
Rekompilieren
|
||||
</string>
|
||||
<string name="CompileQueuePreprocessing">
|
||||
Präprozessieren: [SCRIPT]
|
||||
</string>
|
||||
<string name="CompileQueuePreprocessingComplete">
|
||||
Präprozessieren von Skript [SCRIPT] beendet
|
||||
</string>
|
||||
<string name="ResetQueueTitle">
|
||||
Skripte zurücksetzen
|
||||
</string>
|
||||
|
|
|
|||
|
|
@ -994,6 +994,8 @@ This feature is currently in Beta. Please add your name to this [http://goo.gl/f
|
|||
<string name="CompileNoExperiencePerm">Skipping script [SCRIPT] with Experience [EXPERIENCE].</string>
|
||||
<string name="CompileQueueTitle">Recompilation Progress</string>
|
||||
<string name="CompileQueueStart">recompile</string>
|
||||
<string name="CompileQueuePreprocessing">Proprocessing: [SCRIPT]</string>
|
||||
<string name="CompileQueuePreprocessingComplete">Proprocessing of script [SCRIPT] complete</string>
|
||||
<string name="ResetQueueTitle">Reset Progress</string>
|
||||
<string name="ResetQueueStart">reset</string>
|
||||
<string name="RunQueueTitle">Set Running Progress</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue