mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
My recent PR accesses Connection->cc_ on shutdown, but sometimes it's a null pointer. Make it optional.
This commit is contained in:
parent
e6a8ec8598
commit
3f27bd3eba
2 changed files with 4 additions and 0 deletions
|
@ -838,6 +838,8 @@ void Connection::ShutdownThreadLocal() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Connection::IsCurrentlyDispatching() const {
|
bool Connection::IsCurrentlyDispatching() const {
|
||||||
|
if (!cc_)
|
||||||
|
return false;
|
||||||
return cc_->async_dispatch || cc_->sync_dispatch;
|
return cc_->async_dispatch || cc_->sync_dispatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -233,6 +233,8 @@ class Connection : public util::Connection {
|
||||||
Phase phase_;
|
Phase phase_;
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
|
||||||
|
// A pointer to the ConnectionContext object if it exists. Some connections (like http
|
||||||
|
// requests) don't have it.
|
||||||
std::unique_ptr<ConnectionContext> cc_;
|
std::unique_ptr<ConnectionContext> cc_;
|
||||||
|
|
||||||
unsigned parser_error_ = 0;
|
unsigned parser_error_ = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue