Skip to content

Commit 96e8d03

Browse files
fix(shell): leak fs.watch as a temporary solution of crash
1 parent 856e67a commit 96e8d03

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

scripts/bindgen/quickjs-types.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare module "mshell" {
1717
// helper to access field based on dot path
1818
type FieldPath<T, K extends string> = K extends keyof T ? T[K] : K extends `${infer K1}.${infer K2}` ? K1 extends keyof T ? FieldPath<T[K1], K2> : never : never;
1919

20-
declare function plugin<T = object>(import_meta: { name: string; url: string }, default_config?: T): {
20+
declare function plugin<T = object>(import_meta: { url: string }, default_config?: T): {
2121
i18n: {
2222
define(lang: string, data: { [key: string]: string }): void;
2323
t(key: string): string;
@@ -34,4 +34,6 @@ declare function plugin<T = object>(import_meta: { name: string; url: string },
3434
all(): T;
3535
};
3636
log(...args: any[]): void;
37-
};
37+
};
38+
39+
declare type ShellPluginHelper = ReturnType<typeof plugin>;

src/shell/script/binding_types.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,6 @@ fs::watch(std::string path, std::function<void(std::string, int)> callback) {
10541054
} catch (std::exception &e) {
10551055
std::cerr << "Error in file watch callback: " << e.what() << std::endl;
10561056
}
1057-
1058-
if (*dispose) {
1059-
delete fw;
1060-
}
10611057
});
10621058

10631059
return [dispose] { *dispose = true; };

0 commit comments

Comments
 (0)