Skip to content

Commit

Permalink
Restore commented out logic of preventing parent of modal window bein…
Browse files Browse the repository at this point in the history
…g able to close, which cause user-after-free afterwards.
  • Loading branch information
roytam1 committed Mar 17, 2018
1 parent e9021fe commit 9e62f4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions k-meleon/app/BrowserFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ INT_PTR CBrowserFrame::DoModal()
CWinApp* pApp = AfxGetApp();
if (pApp != NULL)
pApp->EnableModeless(FALSE);
/*

HWND hWndTop = NULL;
HWND hWndParent = CWnd::GetSafeOwner_(GetParent()->GetSafeHwnd(), &hWndTop);

Expand All @@ -1436,19 +1436,19 @@ INT_PTR CBrowserFrame::DoModal()
::EnableWindow(hWndParent, FALSE);
::EnableWindow(m_hWnd, TRUE);
bEnableParent = TRUE;
}*/
}

m_nFlags |= WF_CONTINUEMODAL;
RunModalLoop(0);
/*

if (bEnableParent)
::EnableWindow(hWndParent, TRUE);
if (hWndParent != NULL && ::GetActiveWindow() == m_hWnd)
::SetActiveWindow(hWndParent);

if (::IsWindow(hWndTop))
::EnableWindow(hWndTop, TRUE);
*/

if (pApp != NULL)
pApp->EnableModeless(TRUE);

Expand Down

0 comments on commit 9e62f4f

Please sign in to comment.