Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions uvloop/server.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ cdef class Server:
self._loop._servers.add(self)

cdef _unref(self):
# Server(None) is constructible from Python; guard before touching _loop.
if self._loop is None:
return
self._loop._servers.discard(self)

# Public API
Expand Down Expand Up @@ -77,6 +80,9 @@ cdef class Server:
def close(self):
cdef list servers

if self._loop is None:
return

if self._servers is None:
return

Expand Down
Loading