Make stop() private and use drop() instead.
authorCarl Hetherington <cth@carlh.net>
Sun, 8 Oct 2023 13:48:58 +0000 (15:48 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 18 Oct 2023 11:46:50 +0000 (13:46 +0200)
This avoids confusing situations where we call stop(), then try
to restart the finder (unsuccessfully, because once it's stop()ped
it will stay around, never to be restarted).

src/lib/encode_server_finder.h
src/tools/dcpomatic_cli.cc
test/test.cc

index f8a30af54b295f9a3d6906bd5ab3b878ee6fe805..c478387f9bbaaaaaf799d4ca237382decb1b904e 100644 (file)
@@ -50,8 +50,6 @@ public:
        static EncodeServerFinder* instance ();
        static void drop ();
 
-       void stop ();
-
        std::list<EncodeServerDescription> servers () const;
 
        /** Emitted whenever the list of servers changes */
@@ -62,6 +60,7 @@ private:
        ~EncodeServerFinder ();
 
        void start ();
+       void stop ();
 
        void search_thread ();
        void listen_thread ();
index 96bf830863f2b53266a34176357c8d29f97237fe..2abc3a149189a9520a67f61dad19b9783f71698e 100644 (file)
@@ -413,7 +413,7 @@ main (int argc, char* argv[])
        signal_manager = new SignalManager ();
 
        if (no_remote || export_format) {
-               EncodeServerFinder::instance()->stop ();
+               EncodeServerFinder::drop();
        }
 
        if (json_port) {
index 615e9d3bcd529274f031e76e681ceebdb3efe75d..3d8c91b267e7a7792aad484ae43bd5df00652e92 100644 (file)
@@ -161,7 +161,7 @@ struct TestConfig
                setup_test_config ();
                capture_ffmpeg_logs();
 
-               EncodeServerFinder::instance()->stop ();
+               EncodeServerFinder::drop();
 
                signal_manager = new TestSignalManager ();