Details
Description
Hi,
it looks like that the function
QWindowsSystemTrayIcon::showMessage
has a severe handle leak.
tnd.hBalloonIcon = qt_pixmapToWinHICON(pm);
The icon should get released after displaying the notification.
After ~10000 calls all handles are allocated and the program crashes.
Regards
Alex
QPixmap pm = icon.pixmap(size);
if (pm.isNull())
else {
if (pm.size() != size)
tnd.hBalloonIcon = qt_pixmapToWinHICON(pm);
}
tnd.hWnd = m_hwnd;
tnd.uTimeout = msecsIn <= 0 ? UINT(10000) : UINT(msecsIn); // 10s default
tnd.uFlags = NIF_INFO | NIF_SHOWTIP;
Shell_NotifyIcon(NIM_MODIFY, &tnd);
// RELEASE the icon...
Attachments
Issue Links
- duplicates
-
QTBUG-62945 Windows: QSystemTrayIcon::showMessage causes GDI-Object leak
-
- Closed
-
For Gerrit Dashboard: QTBUG-96348 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
543443,2 | Windows: clean up System Tray Icon message icon | dev | qt/qtbase | Status: MERGED | +2 | 0 |
543821,2 | Windows: clean up System Tray Icon message icon | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
544088,2 | Windows: clean up System Tray Icon message icon | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
544296,4 | Windows: clean up System Tray Icon message icon | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
544645,2 | Windows: clean up System Tray Icon message icon | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
544788,2 | Windows: clean up System Tray Icon message icon | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |