From 9c78453cb7b947029bd053762732913ddbaa5525 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 28 Jun 2012 13:46:14 +0200 Subject: [PATCH] Context references buffer and window with a safe_ptr --- src/context.hh | 4 ++-- src/main.cc | 1 + src/window.hh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/context.hh b/src/context.hh index 4210fce6..86362467 100644 --- a/src/context.hh +++ b/src/context.hh @@ -33,8 +33,8 @@ struct Context } bool has_window() const { return m_window; } public: - Window* m_window; - Buffer* m_buffer; + safe_ptr m_window; + safe_ptr m_buffer; }; diff --git a/src/main.cc b/src/main.cc index e3ead761..c86c33a8 100644 --- a/src/main.cc +++ b/src/main.cc @@ -503,5 +503,6 @@ int main(int argc, char* argv[]) puts(error.description().c_str()); return -1; } + main_context = Context(); return 0; } diff --git a/src/window.hh b/src/window.hh index a4b3abf5..7950cb0e 100644 --- a/src/window.hh +++ b/src/window.hh @@ -21,7 +21,7 @@ class HighlighterGroup; // to the editing ones already provided by the Editor class. // Display can be customized through the use of highlighters handled by // the window's HighlighterGroup -class Window : public Editor, public OptionManagerWatcher +class Window : public Editor, public OptionManagerWatcher, public SafeCountable { public: ~Window();