| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f80bdc5 commit 31f809a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,14 +12,18 @@ function cleanupStaleProcess(filename) { | |||
| 12 | 12 | } | |
| 13 | 13 | process.once('beforeExit', () => { | |
| 14 | 14 | const basename = filename.replace(/.*[/\\]/g, ''); | |
| 15 | - require('child_process') | ||
| 16 | - .execFileSync(`${process.env.SystemRoot}\\System32\\wbem\\WMIC.exe`, [ | ||
| 17 | - 'process', | ||
| 18 | - 'where', | ||
| 19 | - `commandline like '%${basename}%child'`, | ||
| 20 | - 'delete', | ||
| 21 | - '/nointeractive', | ||
| 22 | - ]); | ||
| 15 | + try { | ||
| 16 | + require('child_process') | ||
| 17 | + .execFileSync(`${process.env.SystemRoot}\\System32\\wbem\\WMIC.exe`, [ | ||
| 18 | + 'process', | ||
| 19 | + 'where', | ||
| 20 | + `commandline like '%${basename}%child'`, | ||
| 21 | + 'delete', | ||
| 22 | + '/nointeractive', | ||
| 23 | + ]); | ||
| 24 | + } catch { | ||
| 25 | + // Ignore failures, there might not be any stale process to clean up. | ||
| 26 | + } | ||
| 23 | 27 | }); | |
| 24 | 28 | } | |
| 25 | 29 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments