Fix for bug 382438: null pointer exception when closing statistics view
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / statistics / TmfStatisticsView.java
index 48e6ecb92aa30903af2258481d9494cddea5bb11..e091402653c74053d9f28d3af51f5f44265da652 100755 (executable)
@@ -245,6 +245,8 @@ public class TmfStatisticsView extends TmfView {
             fWaitCursor.dispose();
         }
 
+        // Make sure there is no request running before removing the statistics tree
+        cancelOngoingRequest();
         // clean the model
         TmfStatisticsTreeRootFactory.removeAll();
     }
@@ -500,12 +502,12 @@ public class TmfStatisticsView extends TmfView {
             // Preparation of the event request
             fRequest = new TmfEventRequest<ITmfEvent>(ITmfEvent.class, timeRange, index, TmfDataRequest.ALL_DATA, getIndexPageSize(), ExecutionType.BACKGROUND) {
 
+                private final AbsTmfStatisticsTree statisticsData = TmfStatisticsTreeRootFactory.getStatTree(getTreeID(experiment.getName()));
+
                 @Override
                 public void handleData(ITmfEvent data) {
                     super.handleData(data);
                     if (data != null) {
-                        AbsTmfStatisticsTree statisticsData = TmfStatisticsTreeRootFactory.getStatTree(getTreeID(experiment.getName()));
-
                         final String traceName = data.getTrace().getName();
                         ITmfExtraEventInfo extraInfo = new ITmfExtraEventInfo() {
                             @Override
This page took 0.023783 seconds and 5 git commands to generate.