Use correct internal topic object destructor to avoid C++ API crash (#2963)

.. for consumer errors that originate from light-weight topic objects.
This commit is contained in:
Magnus Edenhill 2020-08-20 15:15:39 +02:00
Родитель fd61c0bafc
Коммит 74dddcbc59
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,14 @@
# librdkafka v1.6.0
## Fixes
### General fixes
* `rd_kafka_topic_opaque()` (used by the C++ API) would cause object
refcounting issues when used on light-weight (error-only) topic objects
such as consumer errors (#2693)
# librdkafka v1.5.0
The v1.5.0 release brings usability improvements, enhancements and fixes to

Просмотреть файл

@ -119,7 +119,9 @@ void rd_kafka_topic_destroy_final (rd_kafka_topic_t *rkt) {
}
/**
* Application destroy
* @brief Application topic object destroy.
* @warning MUST ONLY BE CALLED BY THE APPLICATION.
* Use rd_kafka_topic_destroy0() for all internal use.
*/
void rd_kafka_topic_destroy (rd_kafka_topic_t *app_rkt) {
rd_kafka_lwtopic_t *lrkt;
@ -1487,7 +1489,7 @@ void *rd_kafka_topic_opaque (const rd_kafka_topic_t *app_rkt) {
opaque = rkt->rkt_conf.opaque;
rd_kafka_topic_destroy(rkt); /* loose refcnt from find() */
rd_kafka_topic_destroy0(rkt); /* loose refcnt from find() */
return opaque;
}