Explorar o código

[jsonSerializer] fixed GenericList SerializeObject memory leak

https://github.com/exilon/QuickLib/issues/59
Exilon %!s(int64=4) %!d(string=hai) anos
pai
achega
e7b4326cf1
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      Quick.Json.Serializer.pas

+ 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);