diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index 0df5f509085..91644d57ee0 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -470,7 +470,7 @@ int Server::main(const std::vector & args) bool has_zookeeper = false; if (config().has("zookeeper")) { - global_context->setZooKeeper(new zkutil::ZooKeeper(config(), "zookeeper")); + global_context->setZooKeeper(std::make_shared(config(), "zookeeper")); has_zookeeper = true; } diff --git a/libs/libzkutil/src/tests/zkutil_test_lock.cpp b/libs/libzkutil/src/tests/zkutil_test_lock.cpp index 82d2c6f2591..6acaeaac4a7 100644 --- a/libs/libzkutil/src/tests/zkutil_test_lock.cpp +++ b/libs/libzkutil/src/tests/zkutil_test_lock.cpp @@ -6,7 +6,7 @@ int main() try { - zkutil::Lock l(new zkutil::ZooKeeper("localhost:2181"), "/test", "test_lock"); + zkutil::Lock l(std::make_shared("localhost:2181"), "/test", "test_lock"); std::cout << "check " << l.check() << std::endl; std::cout << "lock tryLock() " << l.tryLock() << std::endl; std::cout << "check " << l.check() << std::endl;