Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
4a632a60
Commit
4a632a60
authored
Oct 02, 2014
by
Pietro Cerutti
Committed by
Jan-Erik Rediger
Jul 27, 2015
Browse files
Make sure to disconnect the adapter in the destructor
parent
9069b147
Changes
2
Show whitespace changes
Inline
Side-by-side
adapters/qt.h
View file @
4a632a60
...
@@ -72,9 +72,16 @@ class RedisQtAdapter : public QObject {
...
@@ -72,9 +72,16 @@ class RedisQtAdapter : public QObject {
RedisQtAdapter
(
QObject
*
parent
=
0
)
RedisQtAdapter
(
QObject
*
parent
=
0
)
:
QObject
(
parent
),
m_ctx
(
0
),
m_read
(
0
),
m_write
(
0
)
{
}
:
QObject
(
parent
),
m_ctx
(
0
),
m_read
(
0
),
m_write
(
0
)
{
}
~
RedisQtAdapter
()
{
}
~
RedisQtAdapter
()
{
if
(
m_ctx
!=
0
)
{
m_ctx
->
ev
.
data
=
NULL
;
}
}
void
setContext
(
redisAsyncContext
*
ac
)
{
int
setContext
(
redisAsyncContext
*
ac
)
{
if
(
ac
->
ev
.
data
!=
NULL
)
{
return
REDIS_ERR
;
}
m_ctx
=
ac
;
m_ctx
=
ac
;
m_ctx
->
ev
.
data
=
this
;
m_ctx
->
ev
.
data
=
this
;
m_ctx
->
ev
.
addRead
=
RedisQtAddRead
;
m_ctx
->
ev
.
addRead
=
RedisQtAddRead
;
...
@@ -82,6 +89,7 @@ class RedisQtAdapter : public QObject {
...
@@ -82,6 +89,7 @@ class RedisQtAdapter : public QObject {
m_ctx
->
ev
.
addWrite
=
RedisQtAddWrite
;
m_ctx
->
ev
.
addWrite
=
RedisQtAddWrite
;
m_ctx
->
ev
.
delWrite
=
RedisQtDelWrite
;
m_ctx
->
ev
.
delWrite
=
RedisQtDelWrite
;
m_ctx
->
ev
.
cleanup
=
RedisQtCleanup
;
m_ctx
->
ev
.
cleanup
=
RedisQtCleanup
;
return
REDIS_OK
;
}
}
private:
private:
...
...
examples/example-qt.h
View file @
4a632a60
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment