Skip to content

[Bug]: Silent crash on Windows when calling BrowserWindow.close() starting from Electron v39.6.1 #50040

@ECRomaneli

Description

@ECRomaneli

Preflight Checklist

Electron Version

39.6.1 or higher

What operating system(s) are you using?

Windows

Operating System Version

Windows 11 Pro version 25H2

What arch are you using?

x64

Last Known Working Electron version

39.6.0

Does the issue also appear in Chromium / Google Chrome?

No

Expected Behavior

Close the BrowserWindow without quitting the application.

Actual Behavior

Whenever I close a BrowserWindow calling window.close(), the window freezes for ~500 milliseconds and crashes the application without any error message or stack trace.

Testcase Gist URL

https://gist.github.com/4f841f8f7d5bd2c4baf6f56f4f4fc0d7

Additional Information

I’ve been finishing up the Windows port for my app, Handbook, and ran into a persistent, silent crash.

After spending a full day debugging, I performed a bisection of the Electron versions to isolate the cause. It appears that the issue was introduced in v39.6.1. My app runs perfectly on v39.6.0, but starting from v39.6.1, the application crashes silently every time BrowserWindow.close() is invoked.

I’m hesitant to report this since I haven't seen other discussions about it, but the reproduction is consistent for me on Windows and it could be a major issue if it is affecting other people.

Tested on:

  • MacOS Tahoe ARM64 (Working)
  • Ubuntu 24.04.4 LTS x64 (Working)
  • Windows 11 Pro version 25H2 x64 (Not Working)

Steps to Reproduce:

  1. Upgrade Electron version to >= 39.6.1.
  2. Create a frameless BrowserWindow (frame set to false).
  3. With the window visible, trigger BrowserWindow.close().
  4. The app terminates silently without an explicit error message.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    🛠️ Fixed for Next Release

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions