BeforeQuit bug #504

Closed
opened 2026-01-29 16:41:23 +00:00 by claunia · 1 comment
Owner

Originally created by @BurtsevC on GitHub (May 28, 2020).

  • Version: v8.31.2
  • Target: .NET Core 3.1
  • electron.manifest.json: "singleInstance": true

Add a listener to Electron.App.BeforeQuit and show MessageBoxResult in it. Try to open the app again while MessageBoxResult is still opening. The problem is more than that, I saw it with Debian when I show MessageBoxResult, close it and tried to open the app for about 5 - 10 seconds after closing. I got the same problem "Object has been destroyed" although the app is closed and even MessageBoxResult is closed.
bug

The same bug can be repeated with WindowAllClosed. Try to open the app while ShowMessageBoxAsync is active.

public void ElectronBootstrap()
{
    Electron.WindowManager.IsQuitOnWindowAllClosed = false;
    Electron.App.WindowAllClosed += App_WindowAllClosed;
}

private async void App_WindowAllClosed()
{
    await Electron.Dialog.ShowMessageBoxAsync("All windows closed");
}
Originally created by @BurtsevC on GitHub (May 28, 2020). - **Version**: v8.31.2 - **Target**: .NET Core 3.1 - **electron.manifest.json**: "singleInstance": true Add a listener to Electron.App.BeforeQuit and show MessageBoxResult in it. Try to open the app again while MessageBoxResult is still opening. The problem is more than that, I saw it with Debian when I show MessageBoxResult, close it and tried to open the app for about 5 - 10 seconds after closing. I got the same problem "Object has been destroyed" although the app is closed and even MessageBoxResult is closed. ![bug](https://user-images.githubusercontent.com/47857073/83139175-9b86f980-a0f4-11ea-9144-aca27c885c93.PNG) The same bug can be repeated with WindowAllClosed. Try to open the app while ShowMessageBoxAsync is active. ``` public void ElectronBootstrap() { Electron.WindowManager.IsQuitOnWindowAllClosed = false; Electron.App.WindowAllClosed += App_WindowAllClosed; } private async void App_WindowAllClosed() { await Electron.Dialog.ShowMessageBoxAsync("All windows closed"); } ```
claunia added the bug label 2026-01-29 16:41:23 +00:00
Author
Owner

@BurtsevC commented on GitHub (Jun 1, 2020):

It's my fault, I have used RequestSingleInstanceLockAsync but forgot to ReleaseSingleInstanceLock in BeforeQuit.

@BurtsevC commented on GitHub (Jun 1, 2020): It's my fault, I have used RequestSingleInstanceLockAsync but forgot to ReleaseSingleInstanceLock in BeforeQuit.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#504