mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-01 19:18:04 +00:00
destruct callbacks (and their closures) to ensure there are no reference cycles when destructing the consumer. This solves a hang in rd_kafka_destroy
This commit is contained in:
@@ -66,6 +66,11 @@ Consumer::Consumer(Configuration config)
|
||||
|
||||
Consumer::~Consumer() {
|
||||
try {
|
||||
// make sure to destroy the function closures. in case they hold kafka
|
||||
// objects, they will need to be destroyed before we destroy the handle
|
||||
assignment_callback_ = nullptr;
|
||||
revocation_callback_ = nullptr;
|
||||
rebalance_error_callback_ = nullptr;
|
||||
close();
|
||||
}
|
||||
catch (const Exception&) {
|
||||
|
||||
Reference in New Issue
Block a user