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:
parent
869f3d0ef1
commit
956f69ffdb
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user