From 87ebf03a64de1534464ef01647cf73fc01277eb0 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 18 Dec 2023 22:23:42 -0500 Subject: [PATCH] CLIENT-2729 Use as_event_loop_size instead of as_event_loop_capacity to check if async commands are enabled. This fixes a memory leak that was caused when event_loops were created and closed and then aerospike_close() was called afterwards. --- src/main/aerospike/aerospike.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/aerospike/aerospike.c b/src/main/aerospike/aerospike.c index 164aada90..dc28dc19a 100644 --- a/src/main/aerospike/aerospike.c +++ b/src/main/aerospike/aerospike.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 Aerospike, Inc. + * Copyright 2008-2023 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. @@ -251,7 +251,7 @@ aerospike_close(aerospike* as, as_error* err) as_cluster* cluster = as->cluster; if (cluster) { - if (as_event_loop_capacity > 0 && !as_event_single_thread) { + if (as_event_loop_size > 0 && !as_event_single_thread) { // Async configurations will attempt to wait till pending async commands have completed. as_event_close_cluster(cluster); }