ContentMenu is never destroyed, so some bits can be removed.
authorCarl Hetherington <cth@carlh.net>
Sun, 20 Nov 2016 18:53:15 +0000 (18:53 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 20 Nov 2016 18:53:15 +0000 (18:53 +0000)
src/wx/content_menu.cc
src/wx/content_menu.h

index 9f3b6333ab4550c866348120b66fb496ddc3ab9d..f332dbe910744c49a6dedbaa556467cb602c9c8e 100644 (file)
@@ -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> film, ContentList c, TimelineContentViewList v, wxPoint p)
 {
@@ -316,15 +306,13 @@ ContentMenu::find_missing ()
 
        shared_ptr<Job> j (new ExamineContentJob (film, content));
 
-       _job_connections.push_back (
-               j->Finished.connect (
-                       bind (
-                               &ContentMenu::maybe_found_missing,
-                               this,
-                               boost::weak_ptr<Job> (j),
-                               boost::weak_ptr<Content> (_content.front ()),
-                               boost::weak_ptr<Content> (content)
-                               )
+       j->Finished.connect (
+               bind (
+                       &ContentMenu::maybe_found_missing,
+                       this,
+                       boost::weak_ptr<Job> (j),
+                       boost::weak_ptr<Content> (_content.front ()),
+                       boost::weak_ptr<Content> (content)
                        )
                );
 
index 84daa71a56e0cd13a749471699d79ab5e0f27e1d..ecbb4a3504e2e7a27e80e0c2c5777d48a945e594 100644 (file)
@@ -35,7 +35,6 @@ class ContentMenu : public boost::noncopyable
 {
 public:
        ContentMenu (wxWindow* p);
-       ~ContentMenu ();
 
        void popup (boost::weak_ptr<Film>, ContentList, TimelineContentViewList, wxPoint);
 
@@ -67,8 +66,6 @@ private:
        wxMenuItem* _ov;
        wxMenuItem* _choose_cpl;
        wxMenuItem* _remove;
-
-       std::list<boost::signals2::connection> _job_connections;
 };
 
 #endif