This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-erlfdb.git

commit a2e6505b92cff2966a855f5c9240c7111e9c1340
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Tue Jan 25 12:31:45 2022 -0500

    Deallocate future mutex in the future resource destructor
    
    Otherwise we end up leaking mutexes 
https://github.com/apache/couchdb-erlfdb/issues/49
---
 c_src/resources.c | 4 ++++
 1 file changed, 4 insertions(+)

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 @@ erlfdb_future_dtor(ErlNifEnv* env, void* obj)
     if(f->msg_env != NULL) {
         enif_free_env(f->msg_env);
     }
+
+    if(f->lock != NULL) {
+        enif_mutex_destroy(f->lock);
+    }
 }
 
 

Reply via email to