Skip to content

Fix the destruction order of handle & destroy_flags #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/cppkafka/kafka_handle_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ class CPPKAFKA_API KafkaHandleBase {
Configuration config_;
TopicConfigurationMap topic_configurations_;
std::mutex topic_configurations_mutex_;
HandlePtr handle_;
int destroy_flags_;
HandlePtr handle_;
};

} // cppkafka
Expand Down
2 changes: 1 addition & 1 deletion src/kafka_handle_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace cppkafka {
const milliseconds KafkaHandleBase::DEFAULT_TIMEOUT{1000};

KafkaHandleBase::KafkaHandleBase(Configuration config)
: timeout_ms_(DEFAULT_TIMEOUT), config_(move(config)), handle_(nullptr, HandleDeleter(this)), destroy_flags_(0) {
: timeout_ms_(DEFAULT_TIMEOUT), config_(move(config)), destroy_flags_(0), handle_(nullptr, HandleDeleter(this)) {
auto& maybe_config = config_.get_default_topic_configuration();
if (maybe_config) {
maybe_config->set_as_opaque();
Expand Down