Release resource created for merge result
authorJon Elverkilde <jon@gameanalytics.com>
Sat, 27 Jun 2015 21:52:19 +0000 (23:52 +0200)
committerJon Elverkilde <jon@gameanalytics.com>
Sat, 27 Jun 2015 21:52:19 +0000 (23:52 +0200)
c_src/hyper_carray.c

index 33bf75c..9f239e8 100644 (file)
@@ -186,7 +186,9 @@ static ERL_NIF_TERM max_merge(ErlNifEnv * env, int argc,
                return enif_make_badarg(env);
        }
 
-       return enif_make_resource(env, acc);
+       ERL_NIF_TERM erl_res = enif_make_resource(env, acc);
+       enif_release_resource(acc);
+       return erl_res;
 }
 
 /*