Skip to content

Commit cdad28e

Browse files
authored
fix: 인게임 오버레이가 제대로 정리되지 않는 오류 수정 (#1735)
1 parent d122ef5 commit cdad28e

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
},
111111
"optionalDependencies": {
112112
"@jellybrick/wql-process-monitor": "1.4.8",
113-
"asdf-overlay-node": "0.7.3",
113+
"asdf-overlay-node": "0.7.4",
114114
"extract-file-icon": "0.3.2",
115115
"hmc-win32": "1.4.92",
116116
"mica-electron": "1.5.16",

src/overlay/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,12 @@ export class OverlayManager {
128128
if (index < 0) return false;
129129

130130
this.registeredProcessList.splice(index, 1);
131-
this.event.emit('unregister-process', pid);
132-
133131
const overlay = this.attachedMap.get(pid);
134132
if (overlay) {
135133
this.attachedMap.delete(pid);
136134
overlay.close();
137135
}
136+
this.event.emit('unregister-process', pid);
138137
return true;
139138
}
140139

src/overlay/win32.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class Win32AttachedOverlay implements AttachedOverlay {
5353
private readonly provider: LyricWindowProvider;
5454
private readonly configWatcher: () => void;
5555

56+
private closed = false;
5657
private constructor(
5758
private viewIndex: number,
5859
private readonly overlay: Overlay,
@@ -67,6 +68,11 @@ class Win32AttachedOverlay implements AttachedOverlay {
6768
},
6869
},
6970
});
71+
overlay.event.on('destroyed', () => {
72+
this.closed = true;
73+
config.unwatch(this.configWatcher);
74+
this.provider.close();
75+
});
7076
const webContents = this.provider.window.webContents;
7177
webContents.on('paint', (e, __, image: Electron.NativeImage) => {
7278
this.updateSurface(image, e.texture?.textureInfo).finally(() => {
@@ -227,9 +233,9 @@ class Win32AttachedOverlay implements AttachedOverlay {
227233
}
228234

229235
close(): void {
230-
config.unwatch(this.configWatcher);
236+
if (this.closed) return;
237+
this.closed = true;
231238
this.overlay.destroy();
232-
this.provider.close();
233239
}
234240

235241
static async initialize(

0 commit comments

Comments
 (0)