+ // Now delete all inputs that are longer in use, and start the others.
+ for (auto input_it = inputs.begin(); input_it != inputs.end(); ) {
+ if (input_it->second.refcount == 0) {
+ if (input_it->first.second == Input::INPUT_ENCODING_RAW) {
+ log(WARNING, "Raw input '%s' no longer in use, closing.",
+ input_it->first.first.c_str());
+ } else {
+ assert(input_it->first.second == Input::INPUT_ENCODING_METACUBE);
+ log(WARNING, "Metacube input '%s' no longer in use, closing.",
+ input_it->first.first.c_str());
+ }
+ input_it->second.input->close_socket();
+ delete input_it->second.input;
+ inputs.erase(input_it++);
+ } else {
+ input_it->second.input->run();
+ ++input_it;
+ }
+ }
+