aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar IceN9ne2017-02-27 19:18:04 -0500
committerGravatar IceN9ne2017-02-27 19:18:04 -0500
commit7ffd04f37914b1358a34906ac4bc561a4806eef3 (patch)
tree4ccb60ec13cee495cb1a0c783f82b7d65809e62d /src/modules
parentAdd wii default alias (diff)
downloadKVIrc-7ffd04f37914b1358a34906ac4bc561a4806eef3.tar.gz
KVIrc-7ffd04f37914b1358a34906ac4bc561a4806eef3.tar.bz2
KVIrc-7ffd04f37914b1358a34906ac4bc561a4806eef3.zip
RawEventWindow: Fix crash when saving raw events
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/raweditor/RawEditorWindow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/raweditor/RawEditorWindow.cpp b/src/modules/raweditor/RawEditorWindow.cpp
index 15a14d22a..53364371a 100644
--- a/src/modules/raweditor/RawEditorWindow.cpp
+++ b/src/modules/raweditor/RawEditorWindow.cpp
@@ -37,7 +37,6 @@
#include "KviApplication.h"
#include "KviCommandFormatter.h"
#include "KviKvsEventManager.h"
-#include "KviKvsEventHandler.h"
#include "KviTalVBox.h"
#include <QMessageBox>
@@ -305,13 +304,14 @@ void RawEditorWidget::commit()
qDebug("Commit handler %s", ((RawHandlerTreeWidgetItem *)ch)->text(0).toUtf8().data());
//int a=(RawTreeWidgetItem *)it)->m_iIdx;
szContext = QString("RawEvent%1::%2").arg(((RawTreeWidgetItem *)it)->m_iIdx).arg(((RawHandlerTreeWidgetItem *)ch)->text(0));
- KviKvsScriptEventHandler s(
+ auto * s = new KviKvsScriptEventHandler(
((RawHandlerTreeWidgetItem *)ch)->text(0),
szContext,
((RawHandlerTreeWidgetItem *)ch)->m_szBuffer,
((RawHandlerTreeWidgetItem *)ch)->m_bEnabled);
- KviKvsEventManager::instance()->addRawHandler(((RawTreeWidgetItem *)it)->m_iIdx, s);
+ if(!KviKvsEventManager::instance()->addRawHandler(((RawTreeWidgetItem *)it)->m_iIdx, s))
+ delete s;
}
}
}