On Mon, 27 Apr 2026 23:47:38 GMT, Phil Race <[email protected]> wrote:
>> src/java.desktop/macosx/native/libawt_lwawt/awt/CFileDialog.m line 133:
>>
>>> 131: [thePanel setDelegate:self];
>>> 132: inModalLoop = YES;
>>> 133: fPanelResult = [thePanel runModalForDirectory:fDirectory
>>> file:fFile];
>>
>> At this point, is it possible that someone has already requested disposal,
>> yet we are still going to show the dialog?
>>
>> Perhaps we can add a new `!isDisposeRequested` check here.
>
> if they call dispose from another thread at around the same time, what do
> they expect to happen ?
> The show to never happen ? That would seem wrong. If it isn't showing
> dispose() basically does nothing.
> Basically you can't dispose it if hasn't been shown
>
> And an app can do
> while (true) {
> dispose()
> show();
> dispose();
> }
>
> and I tested this works as I would expect.
>
> So I don't see a need.
BTW when testing this I found that even some "passing" FileDIalog tests behaved
badly on macOS and now they behave well with this fix. They are closed tests so
I didn't mention them before.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30715#discussion_r3150779917