Qt: check if sender is destroyed during mouse events, otherwise we have access violation. issue #18540

git-svn-id: trunk@29061 -
This commit is contained in:
zeljko 2011-01-17 07:34:57 +00:00
parent af36765fe9
commit 378ac9c3b4

View File

@ -2776,7 +2776,10 @@ begin
end;
NotifyApplicationUserInput(Msg.Msg);
DeliverMessage(Msg);
SetNoMousePropagation(QWidgetH(Sender), True);
// Check if our objects exists since LCL can destroy object during
// mouse events...
if CanSendLCLMessage and (Sender <> nil) then
SetNoMousePropagation(QWidgetH(Sender), True);
end;
QEventMouseButtonRelease:
begin
@ -2791,7 +2794,11 @@ begin
NotifyApplicationUserInput(Msg.Msg);
DeliverMessage(Msg);
SetNoMousePropagation(QWidgetH(Sender), True);
// Check if our objects exists since LCL can destroy object during
// mouse events...
if CanSendLCLMessage and (Sender <> nil) then
SetNoMousePropagation(QWidgetH(Sender), True);
{ Clicking on buttons operates differently, because QEventMouseButtonRelease
is sent if you click a control, drag the mouse out of it and release, but