Skip to content

Commit 69e30f9

Browse files
authored
Merge pull request #39 from arvidn/destruction
destruct callbacks (and their closures)
2 parents 675954e + d173526 commit 69e30f9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/consumer.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ Consumer::Consumer(Configuration config)
6666

6767
Consumer::~Consumer() {
6868
try {
69+
// make sure to destroy the function closures. in case they hold kafka
70+
// objects, they will need to be destroyed before we destroy the handle
71+
assignment_callback_ = nullptr;
72+
revocation_callback_ = nullptr;
73+
rebalance_error_callback_ = nullptr;
6974
close();
7075
}
7176
catch (const Exception&) {

0 commit comments

Comments
 (0)