Skip to content

Commit

Permalink
Store the reference to the RetryHandshake object
Browse files Browse the repository at this point in the history
The RetryHandshake should be referenced so it doesn't get
garbage collected while still in use.
  • Loading branch information
nemanja-boric-sociomantic authored and Gavin Norman committed May 23, 2018
1 parent 89cfee0 commit 817ba2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dhtproto/client/legacy/internal/helper/RetryHandshake.d
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ unittest

// Start the handshake
auto retry_delay_seconds = 3;
new RetryHandshake(this.epoll, this.dht, retry_delay_seconds,
// Store the reference to the RetryHandshake
// object so it doesn't get garbage collected.
auto handshake = new RetryHandshake(this.epoll, this.dht, retry_delay_seconds,
&this.handshake_complete_dg, &this.node_connected_dg);

this.epoll.eventLoop();
Expand Down

0 comments on commit 817ba2e

Please sign in to comment.