From 3b613904ca50e2d900dde785d2837b1a7660e297 Mon Sep 17 00:00:00 2001 From: scottinet Date: Thu, 21 Mar 2019 15:30:20 +0100 Subject: [PATCH] [c++] fix a bad memleak snippet example --- src/sdk-reference/cpp/1/kuzzle/getters/snippets/getters.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdk-reference/cpp/1/kuzzle/getters/snippets/getters.cpp b/src/sdk-reference/cpp/1/kuzzle/getters/snippets/getters.cpp index 5d46edd80..8f0441f4b 100644 --- a/src/sdk-reference/cpp/1/kuzzle/getters/snippets/getters.cpp +++ b/src/sdk-reference/cpp/1/kuzzle/getters/snippets/getters.cpp @@ -1,5 +1,5 @@ -kuzzleio::Kuzzle *kuzzle = new kuzzleio::Kuzzle( - new kuzzleio::WebSocket("kuzzle")); +kuzzleio::WebSocket *ws = new kuzzleio::WebSocket("kuzzle"); +kuzzleio::Kuzzle *kuzzle = new kuzzleio::Kuzzle(ws); std::string jwt_token = kuzzle->jwt(); @@ -21,4 +21,4 @@ bool auto_reconnect = kuzzle->autoReconnect(); bool auto_replay = kuzzle->autoReplay(); -bool auto_resubscribe = kuzzle->autoResubscribe(); \ No newline at end of file +bool auto_resubscribe = kuzzle->autoResubscribe();