We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8688581 commit a0c2a2aCopy full SHA for a0c2a2a
1 file changed
src/greenlet/TThreadStateDestroy.cpp
@@ -162,9 +162,11 @@ struct ThreadState_DestroyNoGIL
162
// The thread_state in the main greenlet has already been
163
// cleared by the time this function runs from our pending
164
// callback, but the greenlet itself is still there.
165
+#ifndef NDEBUG
166
PyGreenlet* main(state->borrow_main_greenlet());
167
assert(main);
168
assert(main->pimpl->thread_state() == nullptr);
169
+#endif
170
delete state; // Deleting this runs the destructor, DECREFs the main greenlet.
171
}
172
0 commit comments