Commit bbf888da authored by Denis Bilenko's avatar Denis Bilenko

replace _default_loop_is_good with _default_loop_destroyed

parent 0aadc935
...@@ -215,7 +215,7 @@ def time(): ...@@ -215,7 +215,7 @@ def time():
return self._ptr.NAME return self._ptr.NAME
cdef bint _default_loop_is_good = True cdef bint _default_loop_destroyed = False
cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]: cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
...@@ -237,7 +237,7 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]: ...@@ -237,7 +237,7 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
else: else:
c_flags = _flags_to_int(flags) c_flags = _flags_to_int(flags)
_check_flags(c_flags) _check_flags(c_flags)
if not _default_loop_is_good: if _default_loop_destroyed:
default = False default = False
if default: if default:
self._ptr = libev.ev_default_loop(c_flags) self._ptr = libev.ev_default_loop(c_flags)
...@@ -267,13 +267,13 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]: ...@@ -267,13 +267,13 @@ cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
#endif #endif
def destroy(self): def destroy(self):
global _default_loop_is_good global _default_loop_destroyed
if self._ptr: if self._ptr:
self._stop_signal_checker() self._stop_signal_checker()
if __SYSERR_CALLBACK == self._handle_syserr: if __SYSERR_CALLBACK == self._handle_syserr:
set_syserr_cb(None) set_syserr_cb(None)
if libev.ev_is_default_loop(self._ptr): if libev.ev_is_default_loop(self._ptr):
_default_loop_is_good = False _default_loop_destroyed = True
libev.ev_loop_destroy(self._ptr) libev.ev_loop_destroy(self._ptr)
self._ptr = NULL self._ptr = NULL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment