]> git.sesse.net Git - casparcg/commitdiff
Fixed followup bug in output.cpp where iterator incrementation happened although...
authorHelge Norberg <helge.norberg@gmail.com>
Wed, 15 May 2013 14:33:35 +0000 (16:33 +0200)
committerHelge Norberg <helge.norberg@gmail.com>
Wed, 15 May 2013 14:33:35 +0000 (16:33 +0200)
Thanks to Robert Nagy for reporting the original bug and spotting the followup bug.

core/consumer/output.cpp

index 263ea1bbf0b519f3e37451d568da5914ea9d9f84..aadfaa3afdd8a08080025e42ef609a159d6c60d0 100644 (file)
@@ -191,7 +191,7 @@ public:
                                std::map<int, boost::unique_future<bool>> send_results;\r
 \r
                                // Start invocations\r
-                               for (auto it = consumers_.begin(); it != consumers_.end(); ++it)\r
+                               for (auto it = consumers_.begin(); it != consumers_.end();)\r
                                {\r
                                        auto consumer   = it->second;\r
                                        auto frame              = frames_.at(consumer->buffer_depth()-minmax.first);\r
@@ -199,6 +199,7 @@ public:
                                        try\r
                                        {\r
                                                send_results.insert(std::make_pair(it->first, consumer->send(frame)));\r
+                                               ++it;\r
                                        }\r
                                        catch(...)\r
                                        {\r
@@ -206,6 +207,7 @@ public:
                                                try\r
                                                {\r
                                                        send_results.insert(std::make_pair(it->first, consumer->send(frame)));\r
+                                                       ++it;\r
                                                }\r
                                                catch(...)\r
                                                {\r