File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,12 @@ _swift_dispatch_release(dispatch_object_t obj) {
165165 dispatch_release (obj);
166166}
167167
168+ SWIFT_CC (swift) DISPATCH_RUNTIME_STDLIB_INTERFACE
169+ extern "C" void
170+ _swift_dispatch_retain(dispatch_object_t obj) {
171+ dispatch_retain (obj);
172+ }
173+
168174// DISPATCH_RUNTIME_STDLIB_INTERFACE
169175// extern "C" dispatch_queue_t
170176// _swift_apply_current_root_queue() {
Original file line number Diff line number Diff line change @@ -188,21 +188,20 @@ extension DispatchSource : DispatchSourceProcess,
188188
189189internal class __DispatchData : DispatchObject {
190190 internal let __wrapped : dispatch_data_t
191- internal let __owned : Bool
192191
193192 final internal override func wrapped( ) -> dispatch_object_t {
194193 return unsafeBitCast ( __wrapped, to: dispatch_object_t. self)
195194 }
196195
197196 internal init ( data: dispatch_data_t , owned: Bool ) {
198197 __wrapped = data
199- __owned = owned
198+ if !owned {
199+ _swift_dispatch_retain ( unsafeBitCast ( data, to: dispatch_object_t. self) )
200+ }
200201 }
201202
202203 deinit {
203- if __owned {
204- _swift_dispatch_release ( wrapped ( ) )
205- }
204+ _swift_dispatch_release ( wrapped ( ) )
206205 }
207206}
208207
@@ -335,3 +334,6 @@ internal enum _OSQoSClass : UInt32 {
335334
336335@_silgen_name ( " _swift_dispatch_release " )
337336internal func _swift_dispatch_release( _ obj: dispatch_object_t ) -> Void
337+
338+ @_silgen_name ( " _swift_dispatch_retain " )
339+ internal func _swift_dispatch_retain( _ obj: dispatch_object_t ) -> Void
You can’t perform that action at this time.
0 commit comments