Skip to content

Commit

Permalink
Merge branch 'fix'
Browse files Browse the repository at this point in the history
Conflicts:
	c_src/erlzmq_nif.c
  • Loading branch information
evax committed Apr 18, 2011
2 parents ec60b1d + b7d36bb commit 6fc00dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions c_src/erlzmq_nif.c
Expand Up @@ -922,6 +922,7 @@ static void * polling_thread(void * handle)
else if (r->type == ERLZMQ_THREAD_REQUEST_TERM) {
enif_mutex_lock(context->mutex);
free(context->thread_socket_name);
// use this to flag context is over
context->thread_socket_name = NULL;
enif_mutex_unlock(context->mutex);
// cleanup pending requests
Expand All @@ -946,6 +947,8 @@ static void * polling_thread(void * handle)
zmq_close(context->thread_socket);
enif_mutex_unlock(context->mutex);
zmq_term(context->context_zmq);
enif_mutex_lock(context->mutex);
enif_mutex_unlock(context->mutex);
enif_mutex_destroy(context->mutex);
enif_release_resource(context);
// notify the waiting request
Expand Down

0 comments on commit 6fc00dc

Please sign in to comment.