Skip to content

Commit

Permalink
Bug 1657073. Make sure to destroy direct manipulation objects before …
Browse files Browse the repository at this point in the history
…we clear our HWND pointer. r=kats

Otherwise when we try to call Deactivate on the direct manipulation manager (to balance the Activate call) we won't have the HWND pointer and so it won't balance and we will leak.

We call DestroyDirectManipulation in nsWindow::Destroy but it looks like nsWindow::OnDestroy can be called before nsWindow::Destroy.

Differential Revision: https://phabricator.services.mozilla.com/D85835
  • Loading branch information
tnikkel committed Aug 4, 2020
1 parent 622666f commit 4dbc8dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions widget/windows/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7347,6 +7347,8 @@ void nsWindow::OnDestroy() {
mWidgetListener = nullptr;
mAttachedWidgetListener = nullptr;

DestroyDirectManipulation();

if (mWnd == mLastKillFocusWindow) {
mLastKillFocusWindow = nullptr;
}
Expand Down

0 comments on commit 4dbc8dd

Please sign in to comment.