Skip to content

Commit a0c2a2a

Browse files
committed
Fix unused variable warning when asserts are disabled.
1 parent 8688581 commit a0c2a2a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/greenlet/TThreadStateDestroy.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ struct ThreadState_DestroyNoGIL
162162
// The thread_state in the main greenlet has already been
163163
// cleared by the time this function runs from our pending
164164
// callback, but the greenlet itself is still there.
165+
#ifndef NDEBUG
165166
PyGreenlet* main(state->borrow_main_greenlet());
166167
assert(main);
167168
assert(main->pimpl->thread_state() == nullptr);
169+
#endif
168170
delete state; // Deleting this runs the destructor, DECREFs the main greenlet.
169171
}
170172

0 commit comments

Comments
 (0)