Remove dangling pointer dereference

The destructor of RedisQtAdapter will be called
_AFTER_ the context has been freed. At this point,
m_ctx is a dangling pointer and should not be dereferenced.
This commit is contained in:
David Ochsner 2023-09-23 10:59:10 +02:00
parent 869f3d0ef1
commit 956f69ffdb

View File

@ -72,12 +72,6 @@ class RedisQtAdapter : public QObject {
RedisQtAdapter(QObject * parent = 0)
: QObject(parent), m_ctx(0), m_read(0), m_write(0) { }
~RedisQtAdapter() {
if (m_ctx != 0) {
m_ctx->ev.data = NULL;
}
}
int setContext(redisAsyncContext * ac) {
if (ac->ev.data != NULL) {
return REDIS_ERR;