Skip to content

Commit 0287f0d

Browse files
committed
more logging for closing tabs / windows
tracking down a crash where tab dragging messages are processed after closing the window, leading to a crash
1 parent 12c625b commit 0287f0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/SumatraPDF.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2669,6 +2669,8 @@ void CloseTab(WindowTab* tab, bool quitIfLast) {
26692669
return;
26702670
}
26712671
MainWindow* win = tab->win;
2672+
logf("CloseTab: tab: 0x%p win: 0x%p, hwndFrame: 0x%x, quitIfLast: %d\n", tab, win, win->hwndFrame, (int)quitIfLast);
2673+
26722674
AbortFinding(win, true);
26732675
ClearFindBox(win);
26742676
RemoveNotificationsForGroup(win->hwndCanvas, kNotifPageInfo);
@@ -2717,6 +2719,8 @@ void CloseTab(WindowTab* tab, bool quitIfLast) {
27172719
// are other windows, else the Frequently Read page is displayed
27182720
void CloseCurrentTab(MainWindow* win, bool quitIfLast) {
27192721
WindowTab* tab = win->CurrentTab();
2722+
logf("CloseCurrentTab: tab: 0x%p win: 0x%p, hwndFrame: 0x%x, quitIfLast: %d\n", tab, win, win->hwndFrame,
2723+
(int)quitIfLast);
27202724
if (tab) {
27212725
CloseTab(tab, quitIfLast);
27222726
} else {
@@ -2755,7 +2759,8 @@ void CloseWindow(MainWindow* win, bool quitIfLast, bool forceClose) {
27552759
if (!win) {
27562760
return;
27572761
}
2758-
2762+
logf("CloseWindow: win: 0x%p, hwndFrame: 0x%x, quitIfLast: %d, forceClose: %d\n", win, win->hwndFrame,
2763+
(int)quitIfLast, (int)forceClose);
27592764
ReportIf(forceClose && !quitIfLast);
27602765
if (forceClose) {
27612766
quitIfLast = true;

0 commit comments

Comments
 (0)