<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:**
  * <!-- (output of `node_modules/.bin/electron --version`) e.g. 4.0.3 -->v10.1.1
* **Operating System:**
  * <!-- (Platform and Version) e.g. macOS 10.13.6 / Windows 10 (1803) / Ubuntu 18.04 x64 -->macOS 10.15.6
* **Last Known Working Electron version:**
  * <!-- (if applicable) e.g. 3.1.0 -->never

### Expected Behavior
<!-- A clear and concise description of what you expected to happen. -->Window can be closed in 'leave-full-screen' event handler without app crash

### Actual Behavior
<!-- A clear and concise description of what actually happened. -->app crashed on trying to close window inside 'leave-full-screen' event handler

### To Reproduce
<!--
Your best chance of getting this bug looked at quickly is to provide an example.
-->just add to electron-quick-start project's main.js:
mainWindow.on('leave-full-screen', (event) => mainWindow.close());

steps to reproduce:
run app, 
open window in fullscreen mode, 
press exit from fullscreen native button.

Expected result: window exits fullscreen mode and closes. App remains running.
Actual result: app crashed with SIGSEGV.

<!--
For bugs that can be encapsulated in a small experiment, you can use Electron Fiddle (https://github.com/electron/fiddle) to publish your example to a GitHub Gist and link it your bug report.
-->

<!--
If Fiddle is insufficient to produce an example, please provide an example REPOSITORY that can be cloned and run. You can fork electron-quick-start (https://github.com/electron/electron-quick-start) and include a link to the branch with your changes.
-->

<!--
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
```sh
$ git clone $YOUR_URL -b $BRANCH
$ npm install
$ npm start || electron .
```
-->

### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

### Additional Information
<!-- Add any other context about the problem here. -->

shell/browser/api/electron_api_browser_window.cc
web_contents()->WasOccluded();
  BaseWindow::OnWindowHide();
}
gin_helper::WrappableBase* BrowserWindow::New(gin_helper::ErrorThrower thrower,
                                              gin::Arguments* args) {
  if (!Browser::Get()->is_ready()) {
    thrower.ThrowError("Cannot create BrowserWindow before app is ready");
    return nullptr;
  }
  if (args->Length() > 1) {
    args->ThrowError();
    return nullptr;
  }
  gin_helper::Dictionary options;
  if (!(args->Length() == 1 && args->GetNext(&options))) {
    options = gin::Dictionary::CreateEmpty(args->isolate());
  }
  return new BrowserWindow(args, options);
}
void BrowserWindow::BuildPrototype(v8::Isolate* isolate,
                                   v8::Local<v8::FunctionTemplate> prototype) {
  prototype->SetClassName(gin::StringToV8(isolate, "BrowserWindow"));
  gin_helper::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
      .SetMethod("focusOnWebView", &BrowserWindow::FocusOnWebView)
      .SetMethod("blurWebView", &BrowserWindow::BlurWebView)
      .SetMethod("isWebViewFocused", &BrowserWindow::IsWebViewFocused)
      .SetProperty("webContents", &BrowserWindow::GetWebContents);
}
v8::Local<v8::Value> BrowserWindow::From(v8::Isolate* isolate,