File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ function maybeDecrementObserverCounts(entryTypes) {
130130 if ( observerType === NODE_PERFORMANCE_ENTRY_TYPE_GC &&
131131 observerCounts [ observerType ] === 0 ) {
132132 removeGarbageCollectionTracking ( ) ;
133+ gcTrackingInstalled = false ;
133134 }
134135 }
135136 }
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ require ( '../common' ) ;
4+
5+ // Refers to https://github.com/nodejs/node/issues/39548
6+
7+ // The test fails if this crashes. If it closes normally,
8+ // then all is good.
9+
10+ const {
11+ PerformanceObserver,
12+ } = require ( 'perf_hooks' ) ;
13+
14+ // We don't actually care if the observer callback is called here.
15+ const gcObserver = new PerformanceObserver ( ( ) => { } ) ;
16+
17+ gcObserver . observe ( { entryTypes : [ 'gc' ] } ) ;
18+
19+ gcObserver . disconnect ( ) ;
20+
21+ const gcObserver2 = new PerformanceObserver ( ( ) => { } ) ;
22+
23+ gcObserver2 . observe ( { entryTypes : [ 'gc' ] } ) ;
24+
25+ gcObserver2 . disconnect ( ) ;
You can’t perform that action at this time.
0 commit comments