diff --git a/Quick.RTTI.Utils.pas b/Quick.RTTI.Utils.pas index 1541554..27c2381 100644 --- a/Quick.RTTI.Utils.pas +++ b/Quick.RTTI.Utils.pas @@ -88,6 +88,7 @@ class function TRTTI.CreateInstance(const Args: array of TValue): T; rmethod: TRttiMethod; rinstype: TRttiInstanceType; begin + Result := Default(T); rtype := fCtx.GetType(TypeInfo(T)); for rmethod in rtype.GetMethods do begin diff --git a/Quick.Threads.pas b/Quick.Threads.pas index b5387ab..9015f56 100644 --- a/Quick.Threads.pas +++ b/Quick.Threads.pas @@ -685,7 +685,7 @@ procedure TThreadedQueueCS.Clear; try for obj in FQueue do begin - if TypeInfo(T) = TypeInfo(TObject) then PObject(@obj){$IFNDEF FPC}.DisposeOf;{$ELSE}.Free;{$ENDIF} + if TypeInfo(T) = TypeInfo(TObject) then PObject(@obj){$ifndef FPC}{$IFDEF DELPHIRX12_UP}.Free{$ELSE}.DisposeOf{$ENDIF}{$ELSE}.Free{$ENDIF}; end; SetLength(FQueue,0);