Gtk3: better fix for crash. issue #41449

This commit is contained in:
zeljan1 2025-02-21 20:13:59 +01:00
parent 87877c4fda
commit dc40fbaf65

View File

@ -2397,7 +2397,7 @@ begin
Event^.button.send_event := NO_PROPAGATION_TO_PARENT;
Result := False;
if SavedHandle <> PtrUInt(Self) then
if (SavedHandle <> PtrUInt(Self)) or (LCLObject = nil) or (FWidget = nil) then
exit;
if Msg.Msg = LM_RBUTTONDOWN then
@ -2407,14 +2407,14 @@ begin
MsgPopup.XPos := SmallInt(Round(Event^.button.x_root));
MsgPopup.YPos := SmallInt(Round(Event^.button.y_root));
DeliverMessage(MsgPopup, True);
if SavedHandle <> PtrUInt(Self) then
if (SavedHandle <> PtrUInt(Self)) or (LCLObject = nil) or (FWidget = nil) then
exit;
end;
if not Result then
begin
Result := DeliverMessage(Msg, True) <> 0;
if SavedHandle <> PtrUInt(Self) then
if (SavedHandle <> PtrUInt(Self)) or (LCLObject = nil) or (FWidget = nil) then
exit;
end;