summaryrefslogtreecommitdiff
path: root/library/iconBuffer.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:03:20 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:03:20 +0200
commit528635604eea1d8c679a3d038e2f00030ef72444 (patch)
tree9c3cbec29aa7d3e209939662e040b9342c9e7400 /library/iconBuffer.cpp
parent3.1 (diff)
downloadFreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.tar.gz
FreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.tar.bz2
FreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.zip
3.2
Diffstat (limited to 'library/iconBuffer.cpp')
-rw-r--r--library/iconBuffer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/library/iconBuffer.cpp b/library/iconBuffer.cpp
index 2f1e2915..d386c85a 100644
--- a/library/iconBuffer.cpp
+++ b/library/iconBuffer.cpp
@@ -143,14 +143,14 @@ void WorkerThread::doWork()
break; //icon already in buffer: enter waiting state
//despite what docu says about SHGetFileInfo() it can't handle all relative filenames, e.g. "\DirName"
- const unsigned int BUFFER_SIZE = 10000;
- DefaultChar fullName[BUFFER_SIZE];
+ const unsigned int MAX_SIZE = 10000;
+ DefaultChar fullName[MAX_SIZE];
const DWORD rv = ::GetFullPathName(
&fileName[0], //__in LPCTSTR lpFileName,
- BUFFER_SIZE, //__in DWORD nBufferLength,
+ MAX_SIZE, //__in DWORD nBufferLength,
fullName, //__out LPTSTR lpBuffer,
NULL); //__out LPTSTR *lpFilePart
- if (rv < BUFFER_SIZE && rv != 0)
+ if (rv < MAX_SIZE && rv != 0)
{
//load icon
SHFILEINFO fileInfo;
@@ -251,7 +251,7 @@ void IconBuffer::insertIntoBuffer(const DefaultChar* fileName, const wxIcon& ico
assert(buffer->size() == bufSequence->size());
//remove elements if buffer becomes too big:
- if (buffer->size() > 1000) //limit buffer size: critical because large buffers seem to cause various wxIcon/wxBitmap issues!
+ if (buffer->size() > BUFFER_SIZE) //limit buffer size: critical because GDI resources are limited (e.g. 10000 on XP per process)
{
//remove oldest element
buffer->erase(bufSequence->front());
bgstack15