Browse Source

minior tweak

KngStr 4 years ago
parent
commit
c4c0d59b32
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Source/ksFmxUtils.pas

+ 4 - 1
Source/ksFmxUtils.pas

@@ -19,8 +19,11 @@ begin
     Exit;
   if Assigned(AFmxObject.Owner) then
     AFmxObject.Owner.RemoveComponent(AFmxObject);
-  if Assigned(AFmxObject.Parent) then
+  if Assigned(AFmxObject.Parent) then begin
+    // fix release error in 10.4, eg: TMemo on TFrame, Windows.
+    AFmxObject.SetRoot(nil);
     AFmxObject.Parent := nil;
+  end;
   FreeObject(AFmxObject);
 end;