소스 검색

unregister event listener correctly

Erik Sundell 7 년 전
부모
커밋
d51f91f54b
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx

+ 2 - 2
public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx

@@ -62,8 +62,8 @@ export class QueryEditor extends React.Component<Props, State> {
   }
   }
 
 
   componentWillUnmount() {
   componentWillUnmount() {
-    this.props.events.off('data-received');
-    this.props.events.off('data-error');
+    this.props.events.off('data-received', this.onDataReceived);
+    this.props.events.off('data-error', this.onDataError);
   }
   }
 
 
   onDataReceived(dataList) {
   onDataReceived(dataList) {