From 9981fe99124d50239c90d26ed9251a7eaf4f21d9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 20 Nov 2016 18:53:15 +0000 Subject: [PATCH] ContentMenu is never destroyed, so some bits can be removed. --- src/wx/content_menu.cc | 26 +++++++------------------- src/wx/content_menu.h | 3 --- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 9f3b6333a..f332dbe91 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -88,19 +88,9 @@ ContentMenu::ContentMenu (wxWindow* p) _parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::kdm, this), ID_kdm); _parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::ov, this), ID_ov); _parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::remove, this), ID_remove); - _parent->Bind (wxEVT_MENU, boost::bind (&ContentMenu::cpl_selected, this, _1), 1, ID_repeat - 1); } -ContentMenu::~ContentMenu () -{ - delete _menu; - - BOOST_FOREACH (boost::signals2::connection& i, _job_connections) { - i.disconnect (); - } -} - void ContentMenu::popup (weak_ptr film, ContentList c, TimelineContentViewList v, wxPoint p) { @@ -316,15 +306,13 @@ ContentMenu::find_missing () shared_ptr j (new ExamineContentJob (film, content)); - _job_connections.push_back ( - j->Finished.connect ( - bind ( - &ContentMenu::maybe_found_missing, - this, - boost::weak_ptr (j), - boost::weak_ptr (_content.front ()), - boost::weak_ptr (content) - ) + j->Finished.connect ( + bind ( + &ContentMenu::maybe_found_missing, + this, + boost::weak_ptr (j), + boost::weak_ptr (_content.front ()), + boost::weak_ptr (content) ) ); diff --git a/src/wx/content_menu.h b/src/wx/content_menu.h index 84daa71a5..ecbb4a350 100644 --- a/src/wx/content_menu.h +++ b/src/wx/content_menu.h @@ -35,7 +35,6 @@ class ContentMenu : public boost::noncopyable { public: ContentMenu (wxWindow* p); - ~ContentMenu (); void popup (boost::weak_ptr, ContentList, TimelineContentViewList, wxPoint); @@ -67,8 +66,6 @@ private: wxMenuItem* _ov; wxMenuItem* _choose_cpl; wxMenuItem* _remove; - - std::list _job_connections; }; #endif -- 2.30.2