aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-24 05:50:25 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-24 05:58:27 +0100
commite030c4e574de9350024fba415450a0017fe48b56 (patch)
treed2eb0d69b69ad84b173c496b9c28792fdf80e381 /src/main.cpp
parent70776212a69ce374b16baa108a21accd0921589d (diff)
downloadsciteco-e030c4e574de9350024fba415450a0017fe48b56.tar.gz
turn off Scintilla undo collection by default and fixed memleak
* in batch mode, Scintilla undo actions are simply leaked memory * Since we have more than one Scintilla view now, we must empty the undo buffer of all scintilla views when a command line is committed ($$)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 463cdfd..9123224 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -357,8 +357,9 @@ main(int argc, char **argv)
QRegisters::globals.insert("\x1B");
Goto::table = &cmdline_goto_table;
- interface.ssm(SCI_EMPTYUNDOBUFFER);
undo.enabled = true;
+ ring.set_scintilla_undo(true);
+ QRegisters::view.set_scintilla_undo(true);
interface.event_loop();
@@ -368,8 +369,10 @@ main(int argc, char **argv)
* in non-interactive mode again.
*/
undo.enabled = false;
- interface.ssm(SCI_EMPTYUNDOBUFFER);
undo.clear();
+ /* also empties all Scintilla undo buffers */
+ ring.set_scintilla_undo(false);
+ QRegisters::view.set_scintilla_undo(false);
try {
QRegisters::hook(QRegisters::HOOK_QUIT);