Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3a3d3bf

Browse files
authoredMay 8, 2019
Merge pull request #4599 from NativeScript/vladimirov/fix-leaking-processes
fix: ensure analytics and cleanup processes are not leaking
2 parents 84a516c + f8443f8 commit 3a3d3bf

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎lib/detached-processes/cleanup-process.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ process.on("message", async (cleanupProcessMessage: ICleanupMessageBase) => {
166166
process.on("disconnect", async () => {
167167
fileLogService.logData({ message: "cleanup-process received process.disconnect event" });
168168
await executeCleanup();
169+
$injector.dispose();
170+
process.exit();
169171
});
170172

171173
fileLogService.logData({ message: `cleanup-process will send ${DetachedProcessMessages.ProcessReadyToReceive} message` });

‎lib/services/analytics/analytics-broker-process.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const finishTracking = async (data?: ITrackingInformation) => {
2929
analyticsLoggingService.logData({ message: `analytics-broker-process finish tracking started` });
3030
await trackingQueue;
3131
analyticsLoggingService.logData({ message: `analytics-broker-process tracking finished` });
32-
process.disconnect();
32+
$injector.dispose();
3333
process.exit();
3434
};
3535

0 commit comments

Comments
 (0)
Please sign in to comment.