mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 12:59:53 +02:00
Qt6: fixed rare crash when QMainWindow is destroyed, removed unneeded FMenuBar.Widget destructor, it will be freed by it's parent.
This commit is contained in:
parent
5ca9daf80f
commit
72db9f09ff
@ -6007,9 +6007,14 @@ var
|
||||
begin
|
||||
if (Widget <> nil) and FOwnWidget then
|
||||
begin
|
||||
ALCLEvent := QLCLMessageEvent_create(LCLQt_DestroyWidget, 0,
|
||||
if QObject_inherits(Widget, 'QMainWindow') then
|
||||
QMainWindow_Destroy(QMainWindowH(Widget))
|
||||
else
|
||||
begin
|
||||
ALCLEvent := QLCLMessageEvent_create(LCLQt_DestroyWidget, 0,
|
||||
0, 0, 0);
|
||||
QCoreApplication_postEvent(Widget, ALCLEvent, Ord(QtHighEventPriority));
|
||||
QCoreApplication_postEvent(Widget, ALCLEvent, Ord(QtHighEventPriority));
|
||||
end;
|
||||
end;
|
||||
Widget := nil;
|
||||
end;
|
||||
@ -7403,11 +7408,6 @@ begin
|
||||
if QtWidgetSet.IsValidHandle(HWND(FMenuBar)) then
|
||||
begin
|
||||
FMenuBar.DetachEvents;
|
||||
if FOwnWidget and (FMenuBar.Widget <> nil) then
|
||||
begin
|
||||
QObject_deleteLater(FMenuBar.Widget);
|
||||
FMenuBar.Widget := nil;
|
||||
end;
|
||||
FMenuBar.Widget := nil;
|
||||
FreeThenNil(FMenuBar);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user