MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / cleanup

Function cleanup

src/native_pdf_export_patch.ts:178–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176 let unloadHandler: (() => void) | null = null;
177
178 const cleanup = () => {
179 if (cleanedUp) return;
180 cleanedUp = true;
181 observer?.disconnect();
182 if (intervalId !== null) {
183 session.ownerWindow.clearInterval(intervalId);
184 }
185 if (unloadHandler) {
186 popupWindow.removeEventListener("beforeunload", unloadHandler);
187 popupWindow.removeEventListener("unload", unloadHandler);
188 }
189 session.popupCleanups.delete(cleanup);
190 session.popupOpened = false;
191 maybeCleanupSession(session, "popup closed");
192 };
193
194 const scanPopup = () => {
195 if (popupWindow.closed) {

Callers 2

scanPopupFunction · 0.85

Calls 2

maybeCleanupSessionFunction · 0.85
debugNativePdfFunction · 0.85

Tested by

no test coverage detected