Skip to content

Commit

Permalink
CLIENT-2729 Use as_event_loop_size instead of as_event_loop_capacity …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
BrianNichols committed Dec 19, 2023
1 parent bce5d56 commit 87ebf03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/aerospike/aerospike.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 87ebf03

Please sign in to comment.