mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 13:40:23 +02:00
Qt6: fix crash if push button is destroyed or recreated inside mouserelease event.
This commit is contained in:
parent
61e7ffa811
commit
e483b7fa0b
@ -6284,13 +6284,18 @@ begin
|
||||
case QEvent_type(Event) of
|
||||
QEventMouseButtonRelease:
|
||||
begin
|
||||
Result := SlotMouse(Sender, Event);
|
||||
if not QWidget_hasFocus(Widget) and
|
||||
(QMouseEvent_button(QMouseEventH(Event)) = QtLeftButton) and
|
||||
(QWidget_focusPolicy(Widget) > QtNoFocus) then
|
||||
begin
|
||||
QObject_blockSignals(Sender, True);
|
||||
Application.QueueAsyncCall(@PushButtonUnblock, PtrInt(Self));
|
||||
BeginEventProcessing;
|
||||
try
|
||||
Result := SlotMouse(Sender, Event);
|
||||
if not QWidget_hasFocus(Widget) and
|
||||
(QMouseEvent_button(QMouseEventH(Event)) = QtLeftButton) and
|
||||
(QWidget_focusPolicy(Widget) > QtNoFocus) then
|
||||
begin
|
||||
QObject_blockSignals(Sender, True);
|
||||
Application.QueueAsyncCall(@PushButtonUnblock, PtrInt(Self));
|
||||
end;
|
||||
finally
|
||||
EndEventProcessing;
|
||||
end;
|
||||
end;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user