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();