View Issue Details

IDProjectCategoryView StatusLast Update
0038849LazarusLCLpublic2021-05-12 03:19
ReporterSalvadorbs Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilityhave not tried
Status confirmedResolutionopen 
Summary0038849: QT5Trayicon's contextMenu broken after recreating popup's handle
DescriptionIf you re-create popup menu handle assigned to a QTrayicon (such as contextmenu), the latter will then have problems and various AVs.

(imho!) Probably with re-creating the handles, QTTrayicon's contextMenu has the old handle. By exiting the application (and thus starting to free up memory) QT tries to free the memory of the old handle, effectively going into SigSegV (it also sometimes does this during the life of the application, imho). This also causes the onClick event issue, with the popup menu being handled by QT.

Demo attached. The PopupMenu1 is assigned to Form1.PopupMenu and Trayicon1.Popup.

This issue is only on KDE distro based with QT5 (not tested on QT4)
Steps To ReproduceStep:
1 Right click in form to open the PopupMenu1 ---> this calls method Popup and destroy & create pm1's handle
2 Close the PopupMenu1

Ok, now the Trayicon1.Popup is broken (it has the old handle of PopupMenu1). If you:
- Click on the button of the form to reload the trayicon's icon -> crash SigBUS or SigSegV
- Right click on the trayicon -> onClick event of the menuitems doesn't work (try to click menu item "ShowMessage")
Additional InformationLazarus Trunk. KDE Neon updated. Widgetset QT5
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetQT5
Attached Files

Activities

Salvadorbs

2021-05-03 22:46

reporter  

PopupMenuQT.zip (296,075 bytes)

Issue History

Date Modified Username Field Change
2021-05-03 22:46 Salvadorbs New Issue
2021-05-03 22:46 Salvadorbs File Added: PopupMenuQT.zip
2021-05-04 10:10 Zeljan Rikalo Assigned To => Zeljan Rikalo
2021-05-04 10:10 Zeljan Rikalo Status new => assigned
2021-05-09 22:03 Zeljan Rikalo Status assigned => confirmed
2021-05-09 22:03 Zeljan Rikalo LazTarget => -