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
-