Skip to content

Commit

Permalink
prevent gMostRecentlyOpenedDoc from pointing to delete DocController (f…
Browse files Browse the repository at this point in the history
…ixes #3918)
  • Loading branch information
kjk committed Nov 29, 2023
1 parent 4dd1e7c commit 084ece5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/WindowTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ WindowTab::~WindowTab() {
AsChm()->RemoveParentHwnd();
}
delete selectionOnPage;
// technically we only need to clear ctrl == gMostRecentlyOpenedDoc
// but gMostRecentlyOpenedDoc is only for dde commands
// so doesn't need to be kept for long
gMostRecentlyOpenedDoc = nullptr;
delete ctrl;
}

Expand Down

1 comment on commit 084ece5

@alibadrelsayed
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I'll give it a try.

Please sign in to comment.