LCL: destroy menu handle on remove. Issue #30806, patch by Michl

git-svn-id: trunk@53250 -
This commit is contained in:
ondrej 2016-10-28 16:43:43 +00:00
parent 4d69ed3456
commit 4161b1f5e1

View File

@ -1743,7 +1743,11 @@ begin
if (Screen.Forms[I].Menu = Value) and (Screen.Forms[I] <> Self) then
raise EInvalidOperation.CreateFmt(sDuplicateMenus, [Value.Name]);
if FMenu <> nil then FMenu.Parent := nil;
if FMenu <> nil then
begin
FMenu.DestroyHandle;
FMenu.Parent := nil;
end;
if (csDestroying in ComponentState) or
((Value <> nil) and (csDestroying in Value.ComponentState)) then