mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 22:40:30 +02:00
* Fix bug ID #32353, reset ref count fields in destructor
git-svn-id: trunk@37112 -
This commit is contained in:
parent
0088673d13
commit
3787d52dee
@ -1050,6 +1050,15 @@
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TInterfacedObject.destroy;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// We must explicitly reset. Bug ID 32353
|
||||||
|
FRefCount:=0;
|
||||||
|
FDestroyCount:=0;
|
||||||
|
inherited destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TInterfacedObject.AfterConstruction;
|
procedure TInterfacedObject.AfterConstruction;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -294,6 +294,8 @@
|
|||||||
VarResult,ExcepInfo,ArgErr : pointer) : HResult;stdcall;
|
VarResult,ExcepInfo,ArgErr : pointer) : HResult;stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TInterfacedObject }
|
||||||
|
|
||||||
TInterfacedObject = class(TObject,IUnknown)
|
TInterfacedObject = class(TObject,IUnknown)
|
||||||
protected
|
protected
|
||||||
frefcount : longint;
|
frefcount : longint;
|
||||||
@ -303,6 +305,7 @@
|
|||||||
function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||||
function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||||
public
|
public
|
||||||
|
destructor destroy; override;
|
||||||
procedure AfterConstruction;override;
|
procedure AfterConstruction;override;
|
||||||
procedure BeforeDestruction;override;
|
procedure BeforeDestruction;override;
|
||||||
class function NewInstance : TObject;override;
|
class function NewInstance : TObject;override;
|
||||||
|
Loading…
Reference in New Issue
Block a user