]> git.sesse.net Git - casparcg/commitdiff
* Fixed bug where it was not possible to exit server until all thumbnails has been...
authorHelge Norberg <helge.norberg@svt.se>
Wed, 28 Oct 2015 15:51:07 +0000 (16:51 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Wed, 28 Oct 2015 15:51:07 +0000 (16:51 +0100)
common/polling_filesystem_monitor.cpp

index 0c82325bacd166ad76d6436aae52eac412fb01ac..c189218ea31ab0d450ef545009477131c33e241f 100644 (file)
@@ -88,13 +88,18 @@ public:
        {
        }
 
-       void reemmit_all()
+       void reemmit_all(const tbb::atomic<bool>& running)
        {
                if (static_cast<int>(events_mask_ & filesystem_event::MODIFIED) == 0)
                        return;
 
                for (auto& file : files_)
+               {
+                       if (!running)
+                               return;
+
                        handler_(filesystem_event::MODIFIED, file.first);
+               }
        }
 
        void reemmit(const boost::filesystem::path& file)
@@ -289,7 +294,7 @@ private:
                try
                {
                        if (reemmit_all_.fetch_and_store(false))
-                               root_monitor_.reemmit_all();
+                               root_monitor_.reemmit_all(running_);
                        else
                        {
                                boost::filesystem::path file;