File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
plugins/plugin-codeflare/src/tray/watchers/profile Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,15 @@ export default class ProfileWatcher {
32
32
private readonly updateFn : UpdateFunction ,
33
33
private readonly profilesPath : string ,
34
34
private readonly watcher = chokidar . watch ( profilesPath , { depth : 1 } )
35
- ) { }
35
+ ) {
36
+ // we need to close the chokidar watcher before exit, otherwise
37
+ // electron-main dies with SIGABRT
38
+ import ( "electron" ) . then ( ( _ ) =>
39
+ _ . app . on ( "will-quit" , async ( ) => {
40
+ await this . watcher . close ( )
41
+ } )
42
+ )
43
+ }
36
44
37
45
/** Initialize `this._profiles` model */
38
46
public async init ( ) : Promise < ProfileWatcher > {
Original file line number Diff line number Diff line change @@ -40,7 +40,15 @@ export default class ProfileRunWatcher {
40
40
private readonly updateFn : UpdateFunction ,
41
41
private readonly profile : string ,
42
42
private readonly watcher = chokidar . watch ( ProfileRunWatcher . path ( profile ) + "/*" , { depth : 1 } )
43
- ) { }
43
+ ) {
44
+ // we need to close the chokidar watcher before exit, otherwise
45
+ // electron-main dies with SIGABRT
46
+ import ( "electron" ) . then ( ( _ ) =>
47
+ _ . app . on ( "will-quit" , async ( ) => {
48
+ await this . watcher . close ( )
49
+ } )
50
+ )
51
+ }
44
52
45
53
private static path ( profile : string ) {
46
54
return Profiles . guidebookJobDataPath ( { profile } )
You can’t perform that action at this time.
0 commit comments