Remove pointless shared_ptr.
authorCarl Hetherington <cth@carlh.net>
Sun, 9 Mar 2025 16:48:38 +0000 (17:48 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 9 Mar 2025 16:48:38 +0000 (17:48 +0100)
src/wx/job_manager_view.cc
src/wx/job_manager_view.h

index b9c064a63bd784851eb71539b5c07f2085be5072..a0a756a930aa8009dfd1d93957b5d3b7ee348a7c 100644 (file)
@@ -57,6 +57,7 @@ using namespace boost::placeholders;
  */
 JobManagerView::JobManagerView(wxWindow* parent, bool batch)
        : wxScrolledWindow(parent)
+       , _timer(this)
        , _batch(batch)
 {
        _panel = new wxPanel(this);
@@ -72,8 +73,7 @@ JobManagerView::JobManagerView(wxWindow* parent, bool batch)
        EnableScrolling(false, true);
 
        Bind(wxEVT_TIMER, boost::bind(&JobManagerView::periodic, this));
-       _timer.reset(new wxTimer(this));
-       _timer->Start(1000);
+       _timer.Start(1000);
 
        JobManager::instance()->JobAdded.connect(bind(&JobManagerView::job_added, this, _1));
        JobManager::instance()->JobsReordered.connect(bind(&JobManagerView::replace, this));
index 1be4575f64489b444cc09e056ecc139b1978c3f0..1dc44f94dae6eef6c29aa0b76b924686c08048af 100644 (file)
@@ -52,7 +52,7 @@ private:
 
        wxPanel* _panel;
        wxFlexGridSizer* _table;
-       std::shared_ptr<wxTimer> _timer;
+       wxTimer _timer;
        bool _batch;
 
        std::list<std::shared_ptr<JobView>> _job_records;