Skip to content

Commit

Permalink
Fixed memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSom committed Oct 14, 2023
1 parent fe65481 commit 1e975ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions es/DockPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ export class DockPanel extends React.PureComponent {
};
this.onPanelHeaderDragEnd = (e) => {
var _a;
if (this._unmounted) {
return;
}
this.setState({ draggingHeader: false });
if (e.dropped === false) {
let { panelData } = this.props;
Expand Down
3 changes: 3 additions & 0 deletions lib/DockPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ class DockPanel extends React.PureComponent {
};
this.onPanelHeaderDragEnd = (e) => {
var _a;
if (this._unmounted) {
return;
}
this.setState({ draggingHeader: false });
if (e.dropped === false) {
let { panelData } = this.props;
Expand Down
3 changes: 3 additions & 0 deletions src/DockPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export class DockPanel extends React.PureComponent<Props, State> {
this.forceUpdate();
};
onPanelHeaderDragEnd = (e: DragState) => {
if (this._unmounted) {
return;
}
this.setState({draggingHeader: false});
if (e.dropped === false) {
let {panelData} = this.props;
Expand Down

0 comments on commit 1e975ec

Please sign in to comment.