mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-04-21 21:52:04 +02:00
Close the RWops if the filesystem fails to open a font.
This commit is contained in:
parent
c20d770c2c
commit
a8019c0a0e
1 changed files with 6 additions and 1 deletions
|
@ -209,7 +209,12 @@ _TTF_Font *SharedFontState::getFont(std::string family,
|
||||||
? req.regular.c_str() : req.other.c_str();
|
? req.regular.c_str() : req.other.c_str();
|
||||||
|
|
||||||
ops = SDL_AllocRW();
|
ops = SDL_AllocRW();
|
||||||
shState->fileSystem().openReadRaw(*ops, path, true);
|
try{
|
||||||
|
shState->fileSystem().openReadRaw(*ops, path, true);
|
||||||
|
} catch (const Exception &e) {
|
||||||
|
SDL_FreeRW(ops);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME 0.9 is guesswork at this point
|
// FIXME 0.9 is guesswork at this point
|
||||||
|
|
Loading…
Add table
Reference in a new issue