* Do not precache anymore if we're low on memory anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39442 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -95,6 +95,13 @@ ImageCache::RetrieveImage(const entry_ref& ref, int32 page,
|
|||||||
QueueEntry* entry;
|
QueueEntry* entry;
|
||||||
|
|
||||||
if (findQueue == fQueueMap.end()) {
|
if (findQueue == fQueueMap.end()) {
|
||||||
|
if (target == NULL && fCacheMap.size() < 5
|
||||||
|
&& fBytes > fMaxBytes * 1 / 2) {
|
||||||
|
// Don't accept any further precaching if we're low on memory
|
||||||
|
// anyway.
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
// Push new entry to the queue
|
// Push new entry to the queue
|
||||||
entry = new(std::nothrow) QueueEntry();
|
entry = new(std::nothrow) QueueEntry();
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user