Skip to content

Commit 3ee33f0

Browse files
authored
Merge pull request confluentinc#33 from confluentinc/destroy_on_close
Destroy rd_kafka_t handle on consumer.close() (confluentinc#30)
2 parents ab60427 + 3b26f01 commit 3ee33f0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

confluent_kafka/src/Consumer.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,18 @@ static PyObject *Consumer_poll (Handle *self, PyObject *args,
391391

392392
static PyObject *Consumer_close (Handle *self, PyObject *ignore) {
393393
CallState cs;
394+
int raise = 0;
394395

395396
CallState_begin(self, &cs);
396397

397398
rd_kafka_consumer_close(self->rk);
398399

399-
if (!CallState_end(self, &cs))
400+
raise = !CallState_end(self, &cs);
401+
402+
rd_kafka_destroy(self->rk);
403+
self->rk = NULL;
404+
405+
if (raise)
400406
return NULL;
401407

402408
Py_RETURN_NONE;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy