2
0
Эх сурвалжийг харах

[jsonSerializer] fixed GenericList SerializeObject memory leak

https://github.com/exilon/QuickLib/issues/59
Exilon 4 жил өмнө
parent
commit
e7b4326cf1

+ 3 - 3
Quick.Json.Serializer.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Version     : 1.12
   Created     : 21/05/2018
-  Modified    : 16/06/2020
+  Modified    : 12/01/2020
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
@@ -1188,7 +1188,6 @@ begin
     Exit;
   end;
 
-  Result := TJSONObject.Create;
   try
     //if is GenericList
     if IsGenericList(aObject) then
@@ -1201,7 +1200,8 @@ begin
       Result := TJSONObject(SerializeValue(propvalue));
       {$ENDIF}
       Exit;
-    end;
+    end
+    else Result := TJSONObject.Create;
     //if is standard object
     propertyname := '';
     rType := ctx.GetType(aObject.ClassInfo);