mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-20 22:59:54 +02:00
Qt: do not raise exception if widget is destroyed in input event, just show an warning via DebugLn, otherwise we have memleaks.
git-svn-id: trunk@37293 -
This commit is contained in:
parent
7ed636df6c
commit
6523578777
@ -5036,10 +5036,13 @@ end;
|
||||
|
||||
function TQtWidget.DeliverMessage(var Msg;
|
||||
const AIsInputEvent: Boolean = False): LRESULT;
|
||||
var
|
||||
AEvent: Cardinal;
|
||||
begin
|
||||
Result := LRESULT(AIsInputEvent);
|
||||
if LCLObject = nil then
|
||||
Exit;
|
||||
AEvent := TLMessage(Msg).Msg;
|
||||
try
|
||||
if LCLObject.HandleAllocated then
|
||||
begin
|
||||
@ -5050,10 +5053,11 @@ begin
|
||||
if AIsInputEvent and (LCLObject = nil) and (PtrUInt(Widget) = 0) and
|
||||
QtWidgetSet.IsValidHandle(HWND(Self)) then
|
||||
begin
|
||||
raise Exception.CreateFmt('%s.DeliverMessage(): error in input event %d ',
|
||||
[ClassName, TLMessage(Msg).Msg]);
|
||||
DebugLn(Format('WARNING: %s has been destroyed while processing input event %u result %u',
|
||||
[ClassName, AEvent, Result]));
|
||||
end else
|
||||
Application.HandleException(nil);
|
||||
raise Exception.CreateFmt('%s.DeliverMessage(): error in event %u result %u',
|
||||
[ClassName, AEvent, Result]);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user