浏览代码

Removed ifdef DisposeOf and added default Result for createinstance, both raise warnings in Delphi 12. The former's function is now depricated and the latter case was likely masked in previous compiler versions.

RyanTMontoya 1 年之前
父节点
当前提交
47bacafa82
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      Quick.RTTI.Utils.pas
  2. 1 1
      Quick.Threads.pas

+ 1 - 0
Quick.RTTI.Utils.pas

@@ -88,6 +88,7 @@ var
   rmethod: TRttiMethod;
   rmethod: TRttiMethod;
   rinstype: TRttiInstanceType;
   rinstype: TRttiInstanceType;
 begin
 begin
+  Result := CreateInstance<T>([]);
   rtype := fCtx.GetType(TypeInfo(T));
   rtype := fCtx.GetType(TypeInfo(T));
   for rmethod in rtype.GetMethods do
   for rmethod in rtype.GetMethods do
   begin
   begin

+ 1 - 1
Quick.Threads.pas

@@ -685,7 +685,7 @@ begin
   try
   try
     for obj in FQueue do
     for obj in FQueue do
     begin
     begin
-      if TypeInfo(T) = TypeInfo(TObject) then PObject(@obj){$IFNDEF FPC}.DisposeOf;{$ELSE}.Free;{$ENDIF}
+      if TypeInfo(T) = TypeInfo(TObject) then PObject(@obj).Free;
     end;
     end;
 
 
     SetLength(FQueue,0);
     SetLength(FQueue,0);