File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed
Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ TEventBase = class(TRefCountedObject)
4949 fNotificationHandler: TNotificationHandler;
5050 fOnChanged: TNotifyEvent;
5151 const
52+ objDestroyingFlag = Integer($80000000 );
5253 DisabledFlag = Integer($40000000 );
5354 RefCountMask = Integer($3FFFFFFF);
5455 { $REGION 'Property Accessors'}
@@ -432,7 +433,7 @@ function TEventBase._Release: Integer;
432433 Result := AtomicDecrement(fRefCount) and not DisabledFlag;
433434 if Result = 0 then
434435 begin
435- __MarkDestroying(Self) ;
436+ fRefCount := objDestroyingFlag ;
436437 Destroy;
437438 end ;
438439end ;
Original file line number Diff line number Diff line change @@ -1320,7 +1320,6 @@ TRefCountedObject = class abstract
13201320 [Volatile]
13211321{ $IFEND}
13221322 fRefCount: Integer;
1323- class procedure __MarkDestroying (const obj); static; inline;
13241323 function AsObject : TObject;
13251324 public
13261325 function QueryInterface (const IID: TGUID; out obj): HResult; stdcall;
@@ -7718,15 +7717,6 @@ function TRefCountedObject.GetRefCount: Integer;
77187717 Result := fRefCount and not objDestroyingFlag;
77197718end ;
77207719
7721- class procedure TRefCountedObject.__MarkDestroying (const obj);
7722- var
7723- refCount: Integer; // FI:W517
7724- begin
7725- repeat
7726- refCount := TRefCountedObject(obj).fRefCount;
7727- until AtomicCmpExchange(TRefCountedObject(obj).fRefCount, refCount or objDestroyingFlag, refCount) = refCount;
7728- end ;
7729-
77307720procedure TRefCountedObject.AfterConstruction ;
77317721begin
77327722 AtomicDecrement(fRefCount);
@@ -7762,7 +7752,7 @@ function TRefCountedObject._Release: Integer;
77627752 Result := AtomicDecrement(fRefCount);
77637753 if Result = 0 then
77647754 begin
7765- __MarkDestroying(Self) ;
7755+ fRefCount := objDestroyingFlag ;
77667756 Destroy;
77677757 end ;
77687758end ;
You can’t perform that action at this time.
0 commit comments