Skip to content

Commit

Permalink
[c++] fix a bad memleak snippet example (#264)
Browse files Browse the repository at this point in the history
# Description

Solve a code snippet resulting in a dangling pointer.
  • Loading branch information
scottinet authored Mar 22, 2019
1 parent 755049c commit 280e927
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sdk-reference/cpp/1/kuzzle/getters/snippets/getters.cpp
Original file line number Diff line number Diff line change
@@ -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();

Expand All @@ -21,4 +21,4 @@ bool auto_reconnect = kuzzle->autoReconnect();

bool auto_replay = kuzzle->autoReplay();

bool auto_resubscribe = kuzzle->autoResubscribe();
bool auto_resubscribe = kuzzle->autoResubscribe();

0 comments on commit 280e927

Please sign in to comment.