Browse Source

* TInterfacedPersistent requires that the interface is requested from the owner if an owner is SetActive
* unified coding style

git-svn-id: trunk@13409 -

florian 16 năm trước cách đây
mục cha
commit
bc8ccacab8
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      rtl/objpas/classes/persist.inc

+ 4 - 4
rtl/objpas/classes/persist.inc

@@ -86,14 +86,14 @@ end;
 procedure TInterfacedPersistent.AfterConstruction;
 begin
   inherited;
-//  if GetOwner<>nil then
-//   GetOwner.GetInterface(IUnknown,FOwnerInterface);
+  if assigned(GetOwner) then
+    GetOwner.GetInterface(IUnknown,FOwnerInterface);
 end;
 
 
 function TInterfacedPersistent._AddRef: Integer;stdcall;
 begin
-  if FOwnerInterface<>nil then
+  if assigned(FOwnerInterface) then
     Result:=FOwnerInterface._AddRef
   else
     Result:=-1;
@@ -102,7 +102,7 @@ end;
 
 function TInterfacedPersistent._Release: Integer;stdcall;
 begin
-  if FOwnerInterface <> nil then
+  if assigned(FOwnerInterface) then
     Result:=FOwnerInterface._Release
   else
     Result:=-1;