@@ -141,7 +141,7 @@ public DataViewComponent.DetailsView[] getDetailsView() {
141
141
detailsViews [0 ] = new DataViewComponent .DetailsView (NbBundle .getMessage (
142
142
CPUSamplerSupport .class , "LBL_Cpu_samples" ), null , 10 , cpuView , null ); // NOI18N
143
143
if (threadsCPU != null ) {
144
- threadCPUView = new ThreadsCPUView (threadCPURefresher );
144
+ threadCPUView = new ThreadsCPUView (threadCPURefresher , threadDumper );
145
145
detailsViews [1 ] = new DataViewComponent .DetailsView (NbBundle .getMessage (
146
146
CPUSamplerSupport .class , "LBL_ThreadAlloc" ), null , 20 , threadCPUView , null ); // NOI18N
147
147
@@ -162,11 +162,13 @@ public boolean startSampling(ProfilingSettings settings, int samplingRate, int r
162
162
refresher .setRefreshRate (refreshRate );
163
163
164
164
final StackTraceSnapshotBuilder _builder = builder ;
165
- if ( cpuView != null ) SwingUtilities .invokeLater (new Runnable () {
165
+ SwingUtilities .invokeLater (new Runnable () {
166
166
public void run () {
167
- cpuView .setBuilder (_builder );
168
- cpuView .starting ();
169
- // cpuView.setResultsPanel(new SampledLivePanel2(builder));
167
+ if (cpuView != null ) {
168
+ cpuView .setBuilder (_builder );
169
+ cpuView .starting ();
170
+ }
171
+ if (threadCPUView != null ) threadCPUView .starting ();
170
172
}
171
173
});
172
174
@@ -187,9 +189,10 @@ public void actionPerformed(ActionEvent e) {
187
189
}
188
190
189
191
public synchronized void stopSampling () {
190
- if ( cpuView != null ) SwingUtilities .invokeLater (new Runnable () {
192
+ SwingUtilities .invokeLater (new Runnable () {
191
193
public void run () {
192
- cpuView .stopping ();
194
+ if (cpuView != null ) cpuView .stopping ();
195
+ if (threadCPUView != null ) threadCPUView .stopping ();
193
196
}
194
197
});
195
198
@@ -204,17 +207,18 @@ public void run() {
204
207
}
205
208
206
209
public synchronized void terminate () {
207
- if ( cpuView != null ) SwingUtilities .invokeLater (new Runnable () {
210
+ SwingUtilities .invokeLater (new Runnable () {
208
211
public void run () {
209
- cpuView .terminated ();
212
+ if (cpuView != null ) cpuView .terminated ();
213
+ if (threadCPUView != null ) threadCPUView .terminated ();
210
214
}
211
215
});
212
216
213
217
if (timer != null ) {
214
218
timer .cancel ();
215
219
timer = null ;
216
220
}
217
- if ( threadCPUView != null ) threadCPUView . terminate ();
221
+
218
222
builder = null ; // release data
219
223
}
220
224
0 commit comments