Qt5,Qt6: fixed crash when QAction is destroyed before it's events are detached. issue #41618

(cherry picked from commit 5ca9daf80f)

Co-authored-by: zeljan1 <zeljko@holobit.hr>
This commit is contained in:
Željan Rikalo 2025-06-03 18:47:18 +02:00
parent 4c7e53d054
commit 6010559863
2 changed files with 10 additions and 8 deletions

View File

@ -16605,10 +16605,6 @@ begin
FActions.Free;
end;
if Assigned(FActionHandle) then
QAction_Destroy(FActionHandle);
FActionHandle := nil;
inherited Destroy;
end;
@ -16662,6 +16658,11 @@ begin
QMenu_hook_destroy(FAboutToHideHook);
FAboutToHideHook := nil;
end;
if Assigned(FActionHandle) then
QAction_Destroy(FActionHandle);
FActionHandle := nil;
inherited DetachEvents;
end;

View File

@ -16519,10 +16519,6 @@ begin
FActions.Free;
end;
if Assigned(FActionHandle) then
QAction_Destroy(FActionHandle);
FActionHandle := nil;
inherited Destroy;
end;
@ -16576,6 +16572,11 @@ begin
QMenu_hook_destroy(FAboutToHideHook);
FAboutToHideHook := nil;
end;
if Assigned(FActionHandle) then
QAction_Destroy(FActionHandle);
FActionHandle := nil;
inherited DetachEvents;
end;