mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix: Unsubscribe from events in dashboards (#19788)
* Unsubscribe on unmount * Fix unsubscribe
This commit is contained in:
parent
f8c474fa1b
commit
945b815fe0
@ -81,6 +81,8 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.props.panel.events.off(PanelEvents.refresh, this.onRefresh);
|
this.props.panel.events.off(PanelEvents.refresh, this.onRefresh);
|
||||||
|
this.props.panel.events.off(PanelEvents.render, this.onRender);
|
||||||
|
|
||||||
if (this.querySubscription) {
|
if (this.querySubscription) {
|
||||||
this.querySubscription.unsubscribe();
|
this.querySubscription.unsubscribe();
|
||||||
this.querySubscription = null;
|
this.querySubscription = null;
|
||||||
|
@ -151,6 +151,9 @@ export class VisualizationTab extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
if (this.querySubscription) {
|
||||||
|
this.querySubscription.unsubscribe();
|
||||||
|
}
|
||||||
this.cleanUpAngularOptions();
|
this.cleanUpAngularOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user