mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
IJPL-172200 IJPL-176167 prevent 'LaterInvocator.forceLeaveAllModals'-induced errors from cancelling IDE exit
(cherry picked from commit ee9547bb2963ffcdc7ebb832a7f28621cdcfe82f) IJ-CR-156309 GitOrigin-RevId: 633c237c621400b1a9d48482f859b2931aee38b5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
368142924f
commit
37152190a5
@@ -285,6 +285,7 @@ private class SaveAndSyncHandlerImpl(private val coroutineScope: CoroutineScope)
|
||||
title = getProgressTitle(componentManager),
|
||||
cancellation = TaskCancellation.nonCancellable(),
|
||||
) {
|
||||
withContext(NonCancellable) {
|
||||
// ensure that is fully canceled
|
||||
currentJob?.join()
|
||||
|
||||
@@ -298,6 +299,7 @@ private class SaveAndSyncHandlerImpl(private val coroutineScope: CoroutineScope)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isAutoSaveCancelled) {
|
||||
requestSave()
|
||||
|
||||
@@ -674,9 +674,14 @@ public final class ApplicationImpl extends ClientAwareComponentManager implement
|
||||
stopServicePreloading();
|
||||
|
||||
if (BitUtil.isSet(flags, SAVE)) {
|
||||
try {
|
||||
TraceKt.use(tracer.spanBuilder("saveSettingsOnExit"),
|
||||
__ -> SaveAndSyncHandler.getInstance().saveSettingsUnderModalProgress(this));
|
||||
}
|
||||
catch (Throwable e) {
|
||||
logErrorDuringExit("Failed to save settings", e);
|
||||
}
|
||||
}
|
||||
|
||||
if (isInstantShutdownPossible()) {
|
||||
for (Frame frame : Frame.getFrames()) {
|
||||
|
||||
@@ -23,6 +23,8 @@ sealed interface TaskCancellation {
|
||||
companion object {
|
||||
/**
|
||||
* @return a cancellation instance, which means that the cancel button should not be displayed in the UI
|
||||
*
|
||||
* It does not indicate that the task is inside [kotlinx.coroutines.NonCancellable] section.
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@JvmStatic
|
||||
|
||||
Reference in New Issue
Block a user