]> git.sesse.net Git - cubemap/blobdiff - serverpool.h
Use in-class initialization for making it harder to forget to set a default.
[cubemap] / serverpool.h
index 87f3f8e4d1837054a036dc0b96e66767f8014312..5f661df2dc175046f6197fdf89177341f704dd5b 100644 (file)
@@ -76,13 +76,13 @@ public:
 
 private:
        std::unique_ptr<Server[]> servers;
-       int num_servers, clients_added;
+       int num_servers, clients_added = 0;
 
        // Our indexing is currently rather primitive; every stream_index in
        // [0, num_http_streams) maps to a HTTP stream (of which every Server
        // has exactly one copy), and after that, it's mapping directly into
        // <udp_streams>.
-       int num_http_streams;
+       int num_http_streams = 0;
        std::vector<std::unique_ptr<UDPStream>> udp_streams;
 
        ServerPool(const ServerPool &);