Set internal DCB to NULL on close
The Backend::dcb() method gives the raw pointer to the internal DCB. This pointer is used by at least readwritesplit to map raw DCB pointers to backends. To prevent stale pointers from being returned, m_dcb needs to be set to NULL after it has been closed.
This commit is contained in:
parent
177e3251ad
commit
f743e99795
@ -158,7 +158,7 @@ public:
|
||||
/**
|
||||
* @brief Get a pointer to the internal DCB
|
||||
*
|
||||
* @return Pointer to internal DCB
|
||||
* @return Pointer to DCB or NULL if not connected
|
||||
*/
|
||||
inline DCB* dcb() const
|
||||
{
|
||||
|
@ -66,6 +66,7 @@ void Backend::close(close_type type)
|
||||
}
|
||||
|
||||
dcb_close(m_dcb);
|
||||
m_dcb = NULL;
|
||||
|
||||
/** decrease server current connection counters */
|
||||
atomic_add(&m_backend->connections, -1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user