mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -30,10 +30,19 @@ namespace filesystem
|
||||
{
|
||||
|
||||
FileData::FileData(uint64 size, const std::string &filename)
|
||||
: data(new char[(size_t) size])
|
||||
: data(nullptr)
|
||||
, size((size_t) size)
|
||||
, filename(filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
data = new char[(size_t) size];
|
||||
}
|
||||
catch (std::bad_alloc &)
|
||||
{
|
||||
throw love::Exception("Out of memory.");
|
||||
}
|
||||
|
||||
if (filename.rfind('.') != std::string::npos)
|
||||
extension = filename.substr(filename.rfind('.')+1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user