NativeScript / ios-jsc

NativeScript for iOS using JavaScriptCore
http://docs.nativescript.org/runtimes/ios
Apache License 2.0
298 stars 59 forks source link

fix(debugging): Do not close data socket prematurely #1255

Closed mbektchiev closed 4 years ago

mbektchiev commented 4 years ago

Multiple dispatch_io operations are usually running simultaneously. When recreating the inspector listening socket after an "AttachRequest" notification from {N} CLI, the following crash happened in a dispather worker thread: BUG IN CLIENT OF LIBDISPATCH: Unexpected EV_VANISHED (do not destroy random mach ports or file descriptors)

The reason turned out to be that we always have at least 2 pending current operations. One is reading the next message, and the other one -- the cleanup handler from dispatch_io_create.

PR Checklist

refs #1254