A simple, small calculator placed discreetly near the Windows Taskbar or anywhere on the screen
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: destroy calculator window before deleting it on exit

CWindowImpl asserts (m_hWnd must be NULL) if the C++ object is deleted while
its HWND is still alive. On Exit the window was only ever hidden (WM_CLOSE),
never destroyed, so 'delete g_calc' tripped the ATL debug assertion. Destroy
the window first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Marco Maroni (Jul 14, 2026, 3:52 PM +0200) 2345eb72 8a659fe8

+6 -2
+6 -2
App.cpp
··· 98 98 TranslateMessage(&m); 99 99 DispatchMessage(&m); 100 100 } 101 - delete g_calc; 102 - g_calc = nullptr; 101 + if (g_calc) { 102 + if (g_calc->IsWindow()) 103 + g_calc->DestroyWindow(); 104 + delete g_calc; 105 + g_calc = nullptr; 106 + } 103 107 if (mutex) { ReleaseMutex(mutex); CloseHandle(mutex); } 104 108 return (int)m.wParam; 105 109 }