mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 18:19:54 +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;
|
||||
|
||||
destructor TInterfacedObject.destroy;
|
||||
|
||||
begin
|
||||
// We must explicitly reset. Bug ID 32353
|
||||
FRefCount:=0;
|
||||
FDestroyCount:=0;
|
||||
inherited destroy;
|
||||
end;
|
||||
|
||||
procedure TInterfacedObject.AfterConstruction;
|
||||
|
||||
begin
|
||||
|
@ -294,6 +294,8 @@
|
||||
VarResult,ExcepInfo,ArgErr : pointer) : HResult;stdcall;
|
||||
end;
|
||||
|
||||
{ TInterfacedObject }
|
||||
|
||||
TInterfacedObject = class(TObject,IUnknown)
|
||||
protected
|
||||
frefcount : longint;
|
||||
@ -303,6 +305,7 @@
|
||||
function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
|
||||
public
|
||||
destructor destroy; override;
|
||||
procedure AfterConstruction;override;
|
||||
procedure BeforeDestruction;override;
|
||||
class function NewInstance : TObject;override;
|
||||
|
Loading…
Reference in New Issue
Block a user