浏览代码

Fixed CacheMem bug when replacing initial position of buffer

Pascal Coin 4 年之前
父节点
当前提交
72aaa486ee
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/libraries/abstractmem/UCacheMem.pas

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

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