Browse Source

unregister all query editor event listeners

Erik Sundell 7 năm trước cách đây
mục cha
commit
b36db6ac04
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      public/app/features/explore/Explore.tsx

+ 4 - 0
public/app/features/explore/Explore.tsx

@@ -178,6 +178,10 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
     }
   }
 
+  componentWillUnmount() {
+    this.exploreEvents.removeAllListeners();
+  }
+
   async setDatasource(datasource: any, origin?: DataSource) {
     const supportsGraph = datasource.meta.metrics;
     const supportsLogs = datasource.meta.logs;