-
-
Notifications
You must be signed in to change notification settings - Fork 736
Closed
Labels
Description
- Version: latest (13.5.1)
- .NET 5
- Target: None;
electronize startwill reproduce
Using the latest Electron.NET API & CLI: if an application has two windows open, then one of them is closed, and you call Reload() on the first one, an error occurs:
A Javascript error occurred in the main process
Uncaught Exception: TypeError: Object has been destroyed
at BrowserWindow.<anonymous>( ... path ... /obj/Host/api/browserWindows.js:205:55 ...
Steps to Reproduce:
- Create a new .NET 5 ASP.NET web application
- Follow the instructions in the readme to set up Electron.NET in the project
- Instead of
Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());, use:
Task.Run(async () =>
{
var mainWindow = await Electron.WindowManager.CreateWindowAsync();
var secondWindow = await Electron.WindowManager.CreateWindowAsync();
secondWindow.Close();
mainWindow.Reload();
}
Alternatively, comment out the Close and Reload lines, and manually close one window and hit Cmd-R on the other.
pleycothh and tareqimbasher