Context references buffer and window with a safe_ptr

This commit is contained in:
Maxime Coste 2012-06-28 13:46:14 +02:00
parent 4dfc910195
commit 9c78453cb7
3 changed files with 4 additions and 3 deletions

View File

@ -33,8 +33,8 @@ struct Context
}
bool has_window() const { return m_window; }
public:
Window* m_window;
Buffer* m_buffer;
safe_ptr<Window> m_window;
safe_ptr<Buffer> m_buffer;
};

View File

@ -503,5 +503,6 @@ int main(int argc, char* argv[])
puts(error.description().c_str());
return -1;
}
main_context = Context();
return 0;
}

View File

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