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
cbb95656
Commit
cbb95656
authored
Sep 19, 2016
by
Paul Scott
Browse files
Prevented uv adapter from calling write when context has been freed
parent
5f98e1d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
adapters/libuv.h
View file @
cbb95656
...
@@ -20,10 +20,10 @@ static void redisLibuvPoll(uv_poll_t* handle, int status, int events) {
...
@@ -20,10 +20,10 @@ static void redisLibuvPoll(uv_poll_t* handle, int status, int events) {
return
;
return
;
}
}
if
(
events
&
UV_READABLE
)
{
if
(
p
->
context
!=
NULL
&&
(
events
&
UV_READABLE
)
)
{
redisAsyncHandleRead
(
p
->
context
);
redisAsyncHandleRead
(
p
->
context
);
}
}
if
(
events
&
UV_WRITABLE
)
{
if
(
p
->
context
!=
NULL
&&
(
events
&
UV_WRITABLE
)
)
{
redisAsyncHandleWrite
(
p
->
context
);
redisAsyncHandleWrite
(
p
->
context
);
}
}
}
}
...
@@ -83,6 +83,7 @@ static void on_close(uv_handle_t* handle) {
...
@@ -83,6 +83,7 @@ static void on_close(uv_handle_t* handle) {
static
void
redisLibuvCleanup
(
void
*
privdata
)
{
static
void
redisLibuvCleanup
(
void
*
privdata
)
{
redisLibuvEvents
*
p
=
(
redisLibuvEvents
*
)
privdata
;
redisLibuvEvents
*
p
=
(
redisLibuvEvents
*
)
privdata
;
p
->
context
=
NULL
;
// indicate that context might no longer exist
uv_close
((
uv_handle_t
*
)
&
p
->
handle
,
on_close
);
uv_close
((
uv_handle_t
*
)
&
p
->
handle
,
on_close
);
}
}
...
...
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