Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, I doubt this has anything to do with your problem, but I would be wary of using <code>nullptr</code> and <code>TRUE</code> as arguments to <code>performOnMainThread:...</code> Instead I would do:</p> <p><code>[JNFRunLoop performOnMainThread:@selector(showOpenFileDialog) on:openFile withObject:nil waitUntilDone:YES];</code></p> <p>Just to be on the safe side.</p> <p>From the stack trace, assuming that is all one big stack and you just separated it to add commentary about your helper object method call, it seems like the code path being taken is the one where <code>[NSThread isMainThread]</code> returns NO. This must mean it's on a background thread (<code>__NSThreadPerformPerform</code> is then doing the bidding of <code>JNFRunLoop</code>).</p> <p>The stack never gets out of the initialization path for the <code>NSOpenPanel</code>, and somehow, way deep down at the bottom, it is again accessing run loop things. In my mind, it seems like there is some kind of deadlock happening.</p> <p>If <code>JNFRunLoop</code> is waiting in another thread on the execution of the <code>showOpenFileDialog</code> method to complete on the main run loop, and something in <code>openPanel</code> is trying to wait on things in that same run loop, that might cause a deadlock.</p> <p>I am unfamiliar with the integration between Java and Cocoa, but might there be some way to avoid executing the first snippet of code on a non-main thread?</p> <p>Alternatively, can you try using:</p> <p><code>[openFile performSelectorOnMainThread:@selector(showOpenFileDialog) withObject:nil waitUntilDone:YES];</code></p> <p>in the non main thread path?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload