commit | a2e6505b92cff2966a855f5c9240c7111e9c1340 | [log] [tgz] |
---|---|---|
author | Nick Vatamaniuc <vatamane@gmail.com> | Tue Jan 25 12:31:45 2022 -0500 |
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | Tue Jan 25 15:48:09 2022 -0500 |
tree | 253db3a6633de14c25d57a06ec3cdba66bc5053b | |
parent | 74a31ce5a14be60b5cd2062da771deff71a06599 [diff] |
Deallocate future mutex in the future resource destructor Otherwise we end up leaking mutexes https://github.com/apache/couchdb-erlfdb/issues/49
diff --git a/c_src/resources.c b/c_src/resources.c index 88f402a..9be74af 100644 --- a/c_src/resources.c +++ b/c_src/resources.c
@@ -74,6 +74,10 @@ if(f->msg_env != NULL) { enif_free_env(f->msg_env); } + + if(f->lock != NULL) { + enif_mutex_destroy(f->lock); + } }