From f14332eac47cb632376277bff634e0d1c6855931 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Tue, 1 Sep 2015 14:08:01 +0200 Subject: [PATCH] Fixed the elusive crash. --- src/notebook.cc | 4 +++- src/window.cc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/notebook.cc b/src/notebook.cc index a733cd9..27addd0 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -104,8 +104,10 @@ void Notebook::open(const boost::filesystem::path &file_path) { }); get_current_view()->on_update_status=[this](Source::View* view, const std::string &status) { - if(get_current_view()==view) + if(get_current_page()!=-1 && get_current_view()==view) Singleton::status()->set_text(status); + else + Singleton::status()->set_text(""); }; } diff --git a/src/window.cc b/src/window.cc index 2fea9b4..1f3fcca 100644 --- a/src/window.cc +++ b/src/window.cc @@ -80,6 +80,7 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil }); notebook.signal_switch_page().connect([this](Gtk::Widget* page, guint page_num) { + DEBUG("start"); if(notebook.get_current_page()!=-1) { if(search_entry_shown && entry_box.labels.size()>0) { notebook.get_current_view()->update_search_occurrences=[this](int number){ @@ -108,6 +109,7 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil Singleton::status()->set_text(notebook.get_current_view()->status); } + DEBUG("end"); }); notebook.signal_page_removed().connect([this](Gtk::Widget* page, guint page_num) { entry_box.hide();