فهرست منبع

Merged revisions 9647,9651,9666-9667 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r9647 | marco | 2008-01-06 01:12:43 +0100 (Sun, 06 Jan 2008) | 2 lines

* isimplementorof/referenceinfo, bug #10567
........
r9651 | marco | 2008-01-06 16:16:56 +0100 (Sun, 06 Jan 2008) | 2 lines

* ancestor of TContainedObject fixed
........
r9666 | marco | 2008-01-07 11:27:40 +0100 (Mon, 07 Jan 2008) | 2 lines

* xpath memleak patch from #10573
........
r9667 | marco | 2008-01-07 12:03:03 +0100 (Mon, 07 Jan 2008) | 2 lines

* TStringlist.customsort now virtual, fixes 10575
........

git-svn-id: branches/fixes_2_2@9733 -

marco 17 سال پیش
والد
کامیت
2232eb9fba
3فایلهای تغییر یافته به همراه36 افزوده شده و 2 حذف شده
  1. 17 1
      packages/fcl-xml/src/xpath.pp
  2. 1 1
      rtl/inc/objpash.inc
  3. 18 0
      rtl/objpas/classes/compon.inc

+ 17 - 1
packages/fcl-xml/src/xpath.pp

@@ -239,6 +239,7 @@ type
     FIsAbsolutePath: Boolean;
   public
     constructor Create(AIsAbsolutePath: Boolean);
+    destructor destroy;override;
     function Evaluate(AContext: TXPathContext;
       AEnvironment: TXPathEnvironment): TXPathVariable; override;
   end;
@@ -439,6 +440,7 @@ type
     { CompleteExpresion specifies wether the parser should check for gargabe
       after the recognised part. True => Throw exception if there is garbage }
     constructor Create(AScanner: TXPathScanner; CompleteExpression: Boolean);
+    destructor destroy;override;
     function Evaluate(AContextNode: TDOMNode): TXPathVariable;
     function Evaluate(AContextNode: TDOMNode;
       AEnvironment: TXPathEnvironment): TXPathVariable;
@@ -893,7 +895,7 @@ begin
   for i := 0 to Predicates.Count - 1 do
     TXPathExprNode(Predicates[i]).Free;
   Predicates.Free;
-  inherited Free;
+  inherited destroy;
 end;
 
 constructor TXPathLocationPathNode.Create(AIsAbsolutePath: Boolean);
@@ -1163,6 +1165,15 @@ begin
   Result := TXPathNodeSetVariable.Create(ResultNodeSet);
 end;
 
+destructor TXPathLocationPathNode.destroy;
+var tmp:TStep;
+begin
+ while FFirstStep<>nil do begin
+  tmp:=FFirstStep.NextStep;
+  FFirstStep.free;
+  FFirstStep:=tmp;
+ end;
+end;
 
 { Exceptions }
 
@@ -2483,6 +2494,11 @@ begin
   end;
 end;
 
+destructor TXPathExpression.destroy;
+begin
+ FRootNode.free;
+end;
+
 function TXPathExpression.Evaluate(AContextNode: TDOMNode;
   AEnvironment: TXPathEnvironment): TXPathVariable;
 var

+ 1 - 1
rtl/inc/objpash.inc

@@ -242,7 +242,7 @@
           property Controller : IUnknown read GetController;
        end;
 
-       TContainedObject = class(TObject)
+       TContainedObject = class(TAggregatedObject,IInterface)
          protected 
            function QueryInterface(const iid : tguid;out obj) : longint;virtual; stdcall;
          end;

+ 18 - 0
rtl/objpas/classes/compon.inc

@@ -24,6 +24,24 @@ begin
     Result:=TComponent(FComponents.Items[Aindex]);
 end;
 
+function TComponent.IsImplementorOf (const Intf:IInterface):boolean;
+var ref : IInterfaceComponentReference;
+begin
+ result:=assigned(intf) and supports(intf,IInterfaceComponentReference,ref);
+ if result then
+   result:=ref.getcomponent=self;
+end;
+
+procedure TComponent.ReferenceInterface(const intf:IInterface;op:TOperation);
+var ref : IInterfaceComponentReference;
+    comp : TComponent;
+begin
+ if assigned(intf) and supports(intf,IInterfaceComponentReference,ref) then
+   begin
+    comp:=ref.getcomponent;
+    comp.notification(self,op); 
+   end;
+end;
 
 Function  TComponent.GetComponentCount: Integer;