@@ -13,26 +13,30 @@ export class NativeScriptDebugAdapter extends ChromeDebugAdapter {
13
13
private _tnsProcess : ChildProcess ;
14
14
15
15
public async attach ( args : any ) : Promise < void > {
16
- const attachArgs = await this . processRequest ( args ) ;
17
- ( this . pathTransformer as any ) . setTargetPlatform ( args . platform ) ;
18
-
19
- return super . attach ( attachArgs ) ;
16
+ return await this . processRequestAndAttach ( args ) ;
20
17
}
21
18
22
19
public async launch ( args : any , telemetryPropertyCollector ?: ITelemetryPropertyCollector ) : Promise < void > {
23
- const launchArgs = await this . processRequest ( args ) as any ;
24
- ( this . pathTransformer as any ) . setTargetPlatform ( args . platform ) ;
25
-
26
- return super . attach ( launchArgs ) ;
20
+ return await this . processRequestAndAttach ( args ) ;
27
21
}
28
22
29
- public async disconnect ( args : any ) {
23
+ public disconnect ( args : any ) : void {
24
+ super . disconnect ( args ) ;
25
+
30
26
if ( this . _tnsProcess ) {
27
+ this . _tnsProcess . stdout . removeAllListeners ( ) ;
28
+ this . _tnsProcess . stderr . removeAllListeners ( ) ;
29
+ this . _tnsProcess . removeAllListeners ( ) ;
31
30
utils . killProcess ( this . _tnsProcess ) ;
32
- this . _tnsProcess = null ;
33
31
}
32
+ }
34
33
35
- super . disconnect ( args ) ;
34
+ private async processRequestAndAttach ( args : any ) {
35
+ const transformedArgs = await this . processRequest ( args ) ;
36
+ ( this . pathTransformer as any ) . setTargetPlatform ( args . platform ) ;
37
+ ( ChromeDebugAdapter as any ) . SET_BREAKPOINTS_TIMEOUT = 20000 ;
38
+
39
+ return super . attach ( transformedArgs ) ;
36
40
}
37
41
38
42
private async processRequest ( args : any ) : Promise < any > {
0 commit comments