Skip to content

Commit

Permalink
Dispose the reporter (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Oct 9, 2018
1 parent ff733a6 commit b1be4c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const testConfigManager: TestConfigManager = new TestConfigManager(projectManage
// your extension is activated the very first time the command is executed
export async function activate(context: ExtensionContext) {
TelemetryWrapper.initilizeFromJsonFile(context.asAbsolutePath('./package.json'));
context.subscriptions.push(TelemetryWrapper.getReporter());
await initializeFromJsonFile(context.asAbsolutePath('./package.json'));
await instrumentOperation('activation', doActivate)(context);
}
Expand Down Expand Up @@ -138,13 +139,12 @@ async function doActivate(_operationId: string, context: ExtensionContext): Prom
await commands.executeCommand('setContext', 'java.test.activated', true);
}

// this method is called when your extension is deactivated
export function deactivate() {
export async function deactivate() {
testResourceManager.dispose();
classPathManager.dispose();
testStatusBarItem.dispose();
CommandUtility.clearCommandsCache();
disposeTelemetryWrapper();
await disposeTelemetryWrapper();
}

function instrumentAndRegisterCommand(name: string, cb: (...args: any[]) => any): Disposable {
Expand Down

0 comments on commit b1be4c4

Please sign in to comment.