浏览代码

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() {
-    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) {