Show More
@@ -116,11 +116,8 b' def _wake(NSApp):' | |||
|
116 | 116 | msg(NSApp, n('postEvent:atStart:'), void_p(event), True) |
|
117 | 117 | |
|
118 | 118 | |
|
119 | _triggered = Event() | |
|
120 | ||
|
121 | 119 | def _input_callback(fdref, flags, info): |
|
122 | 120 | """Callback to fire when there's input to be read""" |
|
123 | _triggered.set() | |
|
124 | 121 | CFFileDescriptorInvalidate(fdref) |
|
125 | 122 | CFRelease(fdref) |
|
126 | 123 | NSApp = _NSApp() |
@@ -134,7 +131,6 b' _c_input_callback = _c_callback_func_type(_input_callback)' | |||
|
134 | 131 | |
|
135 | 132 | def _stop_on_read(fd): |
|
136 | 133 | """Register callback to stop eventloop when there's data on fd""" |
|
137 | _triggered.clear() | |
|
138 | 134 | fdref = CFFileDescriptorCreate(None, fd, False, _c_input_callback, None) |
|
139 | 135 | CFFileDescriptorEnableCallBacks(fdref, kCFFileDescriptorReadCallBack) |
|
140 | 136 | source = CFFileDescriptorCreateRunLoopSource(None, fdref, 0) |
@@ -149,9 +145,3 b' def inputhook(context):' | |||
|
149 | 145 | _stop_on_read(context.fileno()) |
|
150 | 146 | objc.objc_msgSend.argtypes = [void_p, void_p] |
|
151 | 147 | msg(NSApp, n('run')) |
|
152 | if not _triggered.is_set(): | |
|
153 | # app closed without firing callback, | |
|
154 | # probably due to last window being closed. | |
|
155 | # Run the loop manually in this case, | |
|
156 | # since there may be events still to process (#9734) | |
|
157 | CoreFoundation.CFRunLoopRun() |
General Comments 0
You need to be logged in to leave comments.
Login now