mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -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() {
|
||||
this.props.panel.events.off(PanelEvents.refresh, this.onRefresh);
|
||||
this.props.panel.events.off(PanelEvents.render, this.onRender);
|
||||
|
||||
if (this.querySubscription) {
|
||||
this.querySubscription.unsubscribe();
|
||||
this.querySubscription = null;
|
||||
|
@ -151,6 +151,9 @@ export class VisualizationTab extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.querySubscription) {
|
||||
this.querySubscription.unsubscribe();
|
||||
}
|
||||
this.cleanUpAngularOptions();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user