ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/FBActivityMonitor.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/FBActivityMonitor.pas (file contents):
Revision 45 by tony, Tue Dec 6 10:33:46 2016 UTC vs.
Revision 87 by tony, Mon Jan 1 11:31:26 2018 UTC

# Line 25 | Line 25
25   *
26   *)
27   unit FBActivityMonitor;
28 + {$IFDEF MSWINDOWS}
29 + {$DEFINE WINDOWS}
30 + {$ENDIF}
31  
32   {$IFDEF FPC}
33 < {$mode objfpc}{$H+}
33 > {$mode delphi}
34   {$interfaces COM}
35   {$ENDIF}
36  
# Line 47 | Line 50 | type
50  
51    {$IFDEF DEBUGINTERFACES}
52    TMonitoredObject = class(TInterfacedObject)
50  private
51    FObjectCount: integer; static;
53    public
54      constructor Create;
55      destructor Destroy; override;
# Line 152 | Line 153 | end;
153   { TMonitoredObject }
154  
155   {$IFDEF DEBUGINTERFACES}
156 + var
157 +  FObjectCount: integer;
158 +
159   constructor TMonitoredObject.Create;
160   begin
161    inherited Create;
# Line 304 | Line 308 | end;
308  
309   function TInterfaceOwner.HasInterface(index: integer): boolean;
310   begin
311 <  Result := FInterfaces[index] <> nil;
311 >  Result := (Length(FInterfaces) > 0) and (FInterfaces[index] <> nil);
312   end;
313  
314   procedure TInterfaceOwner.Remove(intf: TInterfacedObject);
# Line 336 | Line 340 | procedure TInterfaceOwner.ReleaseInterfa
340   var i: integer;
341   begin
342    for i := 0 to Length(FInterfaces) - 1 do
343 +  begin
344 +    {$IFNDEF FPC}
345 +    {With Delphi we need to explicitly null the object reference when it is
346 +     going to be disposed of. This is because Delphi does not drop the reference
347 +     count until after the containing object is released.}
348 +    if (FInterfaces[i] <> nil) and (FInterfaces[i].RefCount <= 2) then
349 +      FInterfaces[i] := nil;
350 +    {$ENDIF}
351      FInterfaceRefs[i] := nil;
352 +  end;
353   end;
354  
355   end.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines