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:
arvidn
2018-02-08 11:51:36 +01:00
parent deff8b1ff3
commit d173526f99

View File

@@ -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&) {