"win" Object passed to "i18next-electron-fs-backend" has been destroyed
See original GitHub issueEven I change the “close” event handler to:
win.on('closed', event => {
event.preventDefault();
});
The win
object still got destroyed, because I can change “activate” handler to this:
app.on('activate', () => {
if (win.isDestroyed()) {
createWindow();
}
});
And it will recreate the window. This means, though win
is not null
, it is actually destroyed.
And this resulted in the following error:
Uncaught Exception:
Error: Object has been destroyed
at BrowserWindow.<anonymous> (/xxx/node_modules/i18next-electron-fs-backend/lib/index.js:1:2472)
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Object has been destroyed · Issue #1 - GitHub
After closing window, and click the tray icon to recreate window, I get following error: Uncaught Exception: Error: Object has been ...
Read more >"Object has been destroyed" when sending through IPC
The error says that your win object no longer exist, it has been destroyed. The win is reference to new window, it seems...
Read more >Electron Tutorial: Building Modern Desktop Apps with Vue.js
Learn how to leverage Vue.js and Electron to build and secure modern desktop applications.
Read more >angular-in-action.pdf
Angular applications are based around components that communicate with one another. You pass data into a child component using inputs and can emit...
Read more >core-backend Change Log - iTwin.js
Unauthorized open requests should cause a more obvious error. Improved performance logging, especially of IModelDb open operations; ChangeSets are merged one-by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@linonetwo I’ve commented the fix here. The issue has been fixed in the i18next-electron-fs-backend package. You should get version
1.1.2
for the fix and add the code mentioned in the comment.No, I still get
Object has been destroyed
:I think we can’t prevent
win
object to be destroyed, we can only try no to use it if it is destroyed.I’m doing so in IPC related code:
Maybe you have to check
win.isDestroyed()
ini18next-electron-fs-backend
? So this might still belongs toi18next-electron-fs-backend
side.I guess this only happened in MacOS, where the main process is still running, so
i18next-electron-fs-backend
still trying to send something to the window, but windows are actually all destroyed.