<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">This code crashes for me with SwiftFoundation, but not with Darwin Foundation:</div><div class=""><br class=""></div>/// Turn `NSData` into `dispatch_data_t`<br class="">internal func createDispatchData(data: NSData) -> dispatch_data_t {<br class=""> let c = data.copy() as! NSData<br class=""> let info = Unmanaged<NSData>.passRetained(c)<br class=""> let destructor = {<br class=""> info.release()<br class=""> }<br class=""> let q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)!<br class=""> return dispatch_data_create(c.bytes, c.length, q, destructor)<br class="">}<br class=""><br class=""><div class=""><img apple-inline="yes" id="8372539A-9773-45BF-9BE1-593D9F0B42C5" height="136" width="558" apple-width="yes" apple-height="yes" src="cid:BD3CC890-7F1E-4751-9102-ACC506F1BB5F@hitronhub.home" class=""></div><div class=""><br class=""></div><div class="">I'm not sure what to look for. The values being passed into dispatch_data_create() look sane.<br class=""><br class="">Is this a red herring?</div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="2DCEEE28-647E-41EB-98E1-7B59DBA42410" height="158" width="827" apple-width="yes" apple-height="yes" src="cid:52CC9B63-B115-4351-85FD-2481B7B97554@hitronhub.home" class=""></div><div class=""><br class=""></div><div class="">/Daniel</div><div class=""><br class=""></div></body></html>