Skip to content

Commit

Permalink
Popup: Fix memory leak due to element reference in callback closure (m…
Browse files Browse the repository at this point in the history
…icrosoft#11619)

* Popup: Fix disposables and element ref memory leaks

* Change files

* Dispose Async and add comment

* Minimize change-set

* Remove unnecessary newline
  • Loading branch information
KevinTCoughlin authored and JD Huntington committed Jan 8, 2020
1 parent d641984 commit ddd6da4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "patch",
"comment": "Popup: Fix disposables and element ref memory leaks",
"packageName": "office-ui-fabric-react",
"email": "KevinTCoughlin@users.noreply.github.com",
"commit": "721006ed4c2f5f95e8d2f126d2e79a03af2f02a8",
"date": "2020-01-07T01:26:42.776Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export class Popup extends React.Component<IPopupProps, IPopupState> {
this._originalFocusedElement.focus();
}
}

// De-reference DOM Node to avoid retainment via transpiled closure of _onKeyDown
delete this._originalFocusedElement;
}

public render(): JSX.Element {
Expand Down

0 comments on commit ddd6da4

Please sign in to comment.