Explorar el Código

* fixed decrementing of refcount of constant ansistrings in setlength()

git-svn-id: trunk@3651 -
Jonas Maebe hace 19 años
padre
commit
9084587bdc
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      rtl/inc/astrings.inc

+ 2 - 1
rtl/inc/astrings.inc

@@ -399,7 +399,8 @@ begin
             movelen := lens;
           Move(Pointer(S)^,Temp^,movelen);
           { ref count dropped to zero in the mean time? }
-          If declocked(PAnsiRec(Pointer(S)-FirstOff)^.Ref) then
+          If (PAnsiRec(Pointer(S)-FirstOff)^.Ref > 0) and
+             declocked(PAnsiRec(Pointer(S)-FirstOff)^.Ref) then
             freemem(PAnsiRec(Pointer(s)-FirstOff));
           Pointer(S):=Temp;
        end;