cocoa: get file-dialog results atomically
Otherwise, the NSURL object that is returned from the dialog can be relased before we get the result.
This commit is contained in:
parent
027ce3bdc2
commit
99a04d5f52
|
@ -103,11 +103,12 @@
|
|||
(begin0
|
||||
(if (zero? result)
|
||||
#f
|
||||
(if (memq 'multi style)
|
||||
(let ([urls (tell ns URLs)])
|
||||
(for/list ([i (in-range (tell #:type _NSUInteger urls count))])
|
||||
(nsurl->string (tell urls objectAtIndex: #:type _NSUInteger i))))
|
||||
(let ([url (tell ns URL)])
|
||||
(nsurl->string url))))
|
||||
(atomically
|
||||
(if (memq 'multi style)
|
||||
(let ([urls (tell ns URLs)])
|
||||
(for/list ([i (in-range (tell #:type _NSUInteger urls count))])
|
||||
(nsurl->string (tell urls objectAtIndex: #:type _NSUInteger i))))
|
||||
(let ([url (tell ns URL)])
|
||||
(nsurl->string url)))))
|
||||
(release ns)))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user