Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: zero out new loop struct
Browse files Browse the repository at this point in the history
Fixes spurious segfaults in pyuv.
  • Loading branch information
bnoordhuis committed May 4, 2012
1 parent ce129ac commit 6037684
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/unix/loop.c
Expand Up @@ -33,8 +33,10 @@ int uv__loop_init(uv_loop_t* loop, int default_loop) {
#else
int flags = EVFLAG_AUTO;
#endif
memset(loop, 0, sizeof(*loop));
RB_INIT(&loop->uv_ares_handles_);
loop->endgame_handles = NULL;
loop->channel = NULL;
loop->ev = (default_loop ? ev_default_loop : ev_loop_new)(flags);
ev_set_userdata(loop->ev, loop);
eio_channel_init(&loop->uv_eio_channel, loop);
Expand Down

0 comments on commit 6037684

Please sign in to comment.