1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-04 03:40:07 +00:00

New class HeapBlock, which provides a safe and object-oriented way to allocate heap space. I've used HeapBlocks to replace almost all uses of malloc/free throughout the codebase.

This commit is contained in:
Julian Storer 2010-01-02 14:55:44 +00:00
parent 8c988319ec
commit 4ed1d791e5
86 changed files with 22712 additions and 22630 deletions

View file

@ -532,7 +532,8 @@ const String File::getVersion() const throw()
DWORD handle = 0;
DWORD bufferSize = GetFileVersionInfoSize (getFullPathName(), &handle);
void* buffer = juce_calloc (bufferSize);
HeapBlock <char> buffer;
buffer.calloc (bufferSize);
if (GetFileVersionInfo (getFullPathName(), 0, bufferSize, buffer))
{
@ -549,7 +550,6 @@ const String File::getVersion() const throw()
}
}
juce_free (buffer);
return result;
}