Browse Source

Fixed CacheMem bug when replacing initial position of buffer

Pascal Coin 4 years ago
parent
commit
72aaa486ee
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/libraries/abstractmem/UCacheMem.pas

+ 4 - 0
src/libraries/abstractmem/UCacheMem.pas

@@ -549,6 +549,8 @@ begin
       {$ENDIF}
       Exit;
     end;
+  end else if Not Assigned(PCurrent) then begin
+    PCurrent := FCacheData.FindLowest;
   end;
 
   // Will need to create a new "linar struct" because not found a linear struct previously
@@ -677,6 +679,8 @@ begin
       PCurrent^.MarkAsUsed(Self,PCurrent);
       Exit;
     end;
+  end else if Not Assigned(PCurrent) then begin
+    PCurrent := FCacheData.FindLowest;
   end;
 
   // Will need to create a new "linar struct" because not found a linear struct previously