aboutsummaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
Diffstat (limited to 'demo')
-rw-r--r--demo/stream/stream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/demo/stream/stream.c b/demo/stream/stream.c
index c6cc9b23..5a4995e6 100644
--- a/demo/stream/stream.c
+++ b/demo/stream/stream.c
@@ -55,7 +55,7 @@ int
client(const char *url)
{
nng_stream_dialer *dialer;
- nng_aio * aio;
+ nng_aio *aio;
nng_iov iov;
int rv;
@@ -102,6 +102,11 @@ client(const char *url)
// Send ELCOSE to send/recv associated wit this stream
free(iov.iov_buf);
+
+ // stop everything before freeing
+ nng_stream_stop(c1);
+ nng_stream_dialer_stop(dialer);
+
nng_stream_free(c1);
nng_aio_free(aio);
nng_stream_dialer_free(dialer);