electrobun 1.14.0-beta.0 → 1.14.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -322,6 +322,11 @@ export class BrowserView<T extends RPCWithTransport = RPCWithTransport> {
322
322
  };
323
323
  };
324
324
 
325
+ remove() {
326
+ native.symbols.webviewRemove(this.ptr);
327
+ delete BrowserViewMap[this.id];
328
+ }
329
+
325
330
  static getById(id: number) {
326
331
  return BrowserViewMap[id];
327
332
  }
@@ -62,7 +62,15 @@ export const BrowserWindowMap: {
62
62
 
63
63
  // Clean up the window map when a window closes and optionally quit the app
64
64
  electrobunEventEmitter.on("close", (event: { data: { id: number } }) => {
65
- delete BrowserWindowMap[event.data.id];
65
+ const windowId = event.data.id;
66
+ delete BrowserWindowMap[windowId];
67
+
68
+ // Clean up all webviews associated with this window
69
+ for (const view of BrowserView.getAll()) {
70
+ if (view.windowId === windowId) {
71
+ view.remove();
72
+ }
73
+ }
66
74
 
67
75
  const exitOnLastWindowClosed =
68
76
  buildConfig.runtime?.exitOnLastWindowClosed ?? true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "1.14.0-beta.0",
3
+ "version": "1.14.2-beta.0",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",