aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ring.h
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/ring.h
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/ring.h')
-rw-r--r--src/ring.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/ring.h b/src/ring.h
index 1fc135f..d259500 100644
--- a/src/ring.h
+++ b/src/ring.h
@@ -38,6 +38,8 @@ namespace SciTECO {
*/
class Buffer : private IOView {
+ TAILQ_ENTRY(Buffer) buffers;
+
class UndoTokenClose : public UndoToken {
Buffer *buffer;
@@ -48,9 +50,13 @@ class Buffer : private IOView {
void run(void);
};
-public:
- TAILQ_ENTRY(Buffer) buffers;
+ inline void
+ undo_close(void)
+ {
+ undo.push(new UndoTokenClose(this));
+ }
+public:
gchar *filename;
bool dirty;
@@ -115,11 +121,11 @@ public:
}
void save(const gchar *filename = NULL);
- inline void
- undo_close(void)
- {
- undo.push(new UndoTokenClose(this));
- }
+ /*
+ * Ring manages the buffer list and has privileged
+ * access.
+ */
+ friend class Ring;
};
/* object declared in main.cpp */
@@ -195,6 +201,8 @@ public:
{
current->undo_close();
}
+
+ void set_scintilla_undo(bool state);
} ring;
/*