anchor.diff:  
   destructor TWeakReference<T>.Destroy;
   var
  -  weakRef : IWeakReferenceableObject;
  -begin
  -  if IsAlive then
  +  target : IWeakReferenceableObject;
  +begin
  +  if FData <> nil then
     begin
  -    if Supports(FData,IWeakReferenceableObject,weakRef) then
  +    if SafeMonitorTryEnter(FData) then //FData could become nil
       begin
  -      weakRef.RemoveWeakRef(@FData);
  -      weakRef := nil;
  +      //get a strong reference to the target
  +      if Supports(FData,IWeakReferenceableObject,target) then
  +      begin
  +        target.RemoveWeakRef(@FData);
  +        target := nil; //release the reference asap.
  +      end;
  +      MonitorExit(FData);
       end;
  -  end;
  -  FData := nil;
  +    FData := nil;
  +  end;
     inherited;
   end;
   
  
positive.code: end;
  {$ENDIF}
  {$ENDIF DELPHI_XE2_UPE2}
  
  
  
  constructor TWeakReference<T>.Create(const data: T);
  var
    weakRef : IWeakReferenceableObject;
    d : IInterface;
  begin
    d := IInterface(data);
    if Supports(d,IWeakReferenceableObject,weakRef) then
    begin
      FData := d as TObject;
      weakRef.AddWeakRef(@FData);
    end
    else
      raise Exception.Create(SWeakReferenceError);
  
negative.code: interface
  
  {$I DUnitX.inc}
  uses
    System.Generics.Collections;
  
  type
    /// Implemented by our weak referenced object base class
  