aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-ncurses.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-16 23:46:08 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-17 03:56:42 +0100
commit2542eb02648294256a01ae4ecb6ac81bc8ab5094 (patch)
tree81166dbe78031f7764ca2d6d4925d96283ac29c5 /src/interface-ncurses.cpp
parente762a43754ba375789fa749ca2e00a3548500d6a (diff)
downloadsciteco-2542eb02648294256a01ae4ecb6ac81bc8ab5094.tar.gz
Make sure QRegister::view is properly initialized and cleaned up
* it must be initialized after the UI (Interface::main), so I added a View::initialize() function * the old initialize() method was renamed to setup() * use a global instance of QRegister::view so it is guaranteed to be destroyed only after any QRegisters that could still need it * Document API adapted to work with ViewCurrent references
Diffstat (limited to 'src/interface-ncurses.cpp')
-rw-r--r--src/interface-ncurses.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/interface-ncurses.cpp b/src/interface-ncurses.cpp
index 0be2145..32c310c 100644
--- a/src/interface-ncurses.cpp
+++ b/src/interface-ncurses.cpp
@@ -56,7 +56,8 @@ static void scintilla_notify(Scintilla *sci, int idFrom,
#define SCI_COLOR_ATTR(f, b) \
((chtype)COLOR_PAIR(SCI_COLOR_PAIR(f, b)))
-ViewNCurses::ViewNCurses()
+void
+ViewNCurses::initialize_impl(void)
{
WINDOW *window;
@@ -75,13 +76,7 @@ ViewNCurses::ViewNCurses()
/* Set up window position: never changes */
mvwin(window, 1, 0);
- initialize();
-}
-
-ViewNCurses::~ViewNCurses()
-{
- delwin(get_window());
- scintilla_delete(sci);
+ setup();
}
void