Skip to content

Commit f744191

Browse files
committed
Improve comment [skip ci]
1 parent a740a01 commit f744191

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

yasio/io_service.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,11 +834,10 @@ void io_service::handle_stop()
834834
if (this->state_ != state::AT_EXITING)
835835
{
836836
// after join if state not AT_EXITING, means worker thread was terminated externally
837-
// i.g .net managed exception occurred when invoke c# delegate
837+
// i.g .net managed exception occurred when invoke c# delegate and we should clear pending
838+
// events to prevent dispatch to io event handler again
838839
YASIO_KLOGW("[core] the worker thread terminated unexpectedly");
839840
handle_worker_exit();
840-
// clear pending events to prevent dispatch to io event handler due to the handler
841-
// has unexpected exception
842841
this->events_.clear();
843842
}
844843
}

0 commit comments

Comments
 (0)