How to delete active dialogs on applicationWillTerminate?

When a DialogWindow is present on screen and the user swipes the app up to close it, I’m getting an assert in juce_Desktop because a dialog is still active. I’m trying to close things in applicationWillTerminate, but can’t seem to find a way. DialogWindow doesn’t have a reference anywhere in my app, it’s just launched with .launchAsync(). If I do try to keep a reference and call exitModalState(0) on it in applicationWillTerminate(), the same assert just happens, probably because it’s an async call. This is on iOS14. Any suggestions?