diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index 0a11fb394..ff327e960 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -161,13 +161,13 @@ private: PtrArray *conns; #endif // DEBUG // std::map, std::vector > my_connections; - PtrArray *servers; + std::unique_ptr servers; public: MYSQL * get_connection(char *hostname, int port, MySQL_Monitor_State_Data *mmsd); void put_connection(char *hostname, int port, MYSQL *my); void purge_some_connections(); MySQL_Monitor_Connection_Pool() { - servers = new PtrArray(); + servers = std::unique_ptr(new PtrArray()); #ifdef DEBUG conns = new PtrArray(); pthread_mutex_init(&m2, NULL);