We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e08690b commit 068ef6dCopy full SHA for 068ef6d
src/aalink.cpp
@@ -88,8 +88,12 @@ struct Scheduler {
88
if (link_beat > it->link_beat) {
89
nb::gil_scoped_acquire acquire;
90
91
- auto loop_call_soon_threadsafe = m_loop.attr("call_soon_threadsafe");
92
- loop_call_soon_threadsafe(nb::cpp_function(&set_future_result), it->future, it->link_beat);
+ bool loop_is_running = nb::cast<bool>(m_loop.attr("is_running")());
+
93
+ if (loop_is_running) {
94
+ auto loop_call_soon_threadsafe = m_loop.attr("call_soon_threadsafe");
95
+ loop_call_soon_threadsafe(nb::cpp_function(&set_future_result), it->future, it->link_beat);
96
+ }
97
98
it = m_events.erase(it);
99
} else {
0 commit comments