ISOTP and Scripting bug fixes
This commit is contained in:
+7
-2
@@ -204,7 +204,7 @@ void ScriptingWindow::loadNewScript()
|
||||
QString justFileName = fileList[fileList.length() - 1];
|
||||
ui->listLoadedScripts->addItem(justFileName);
|
||||
|
||||
container = new ScriptContainer;
|
||||
container = new ScriptContainer();
|
||||
container->fileName = justFileName;
|
||||
container->filePath = filename;
|
||||
container->scriptText = contents;
|
||||
@@ -223,7 +223,7 @@ void ScriptingWindow::createNewScript()
|
||||
{
|
||||
ScriptContainer *container;
|
||||
|
||||
container = new ScriptContainer;
|
||||
container = new ScriptContainer();
|
||||
|
||||
container->fileName = "UNNAMED_" + QString::number((qrand() % 10000)) + ".js";
|
||||
container->filePath = QString();
|
||||
@@ -238,6 +238,8 @@ void ScriptingWindow::createNewScript()
|
||||
|
||||
void ScriptingWindow::deleteCurrentScript()
|
||||
{
|
||||
ScriptContainer* thisScript;
|
||||
|
||||
int sel = ui->listLoadedScripts->currentRow();
|
||||
if (sel < 0) return;
|
||||
|
||||
@@ -250,7 +252,10 @@ void ScriptingWindow::deleteCurrentScript()
|
||||
{
|
||||
case QMessageBox::Yes:
|
||||
ui->listLoadedScripts->takeItem(sel);
|
||||
thisScript = scripts.at(sel);
|
||||
scripts.removeAt(sel);
|
||||
delete thisScript; //causes a seg fault. Seems to be due to currently running javascript code. No idea how to stop code from running
|
||||
thisScript = NULL;
|
||||
currentScript = NULL;
|
||||
|
||||
if (ui->listLoadedScripts->count() > 0)
|
||||
|
||||
Reference in New Issue
Block a user