mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 00:49:29 +02:00
Qt: always DetachEvents, also do not call QObject_delete() from TQtWidget.DestroyWidget if InEvent=True, postpone as
QObject_deleteLater(). fixes crashes when huge amount of input events is processed but object is destroyed in the meantime. git-svn-id: trunk@30005 -
This commit is contained in:
parent
c55776f210
commit
e65ea3f1b8
@ -1785,8 +1785,7 @@ end;
|
||||
procedure TQtWidget.DeInitializeWidget;
|
||||
begin
|
||||
QtWidgetSet.RemoveHandle(Self);
|
||||
if Widget <> nil then
|
||||
DetachEvents;
|
||||
DetachEvents;
|
||||
|
||||
if Widget <> nil then
|
||||
removeProperty(Widget, 'lclwidget');
|
||||
@ -4488,7 +4487,7 @@ procedure TQtWidget.DestroyWidget;
|
||||
begin
|
||||
if (Widget <> nil) and FOwnWidget then
|
||||
begin
|
||||
if not FDeleteLater then
|
||||
if not FDeleteLater and not InEvent then
|
||||
QWidget_destroy(Widget)
|
||||
else
|
||||
QObject_deleteLater(Widget);
|
||||
|
Loading…
Reference in New Issue
Block a user