MRI: load_data: Catch exceptions and pass onto ruby
This commit is contained in:
parent
05041fdb03
commit
3a29385df0
|
@ -43,7 +43,16 @@ static VALUE
|
||||||
fileIntForPath(const char *path)
|
fileIntForPath(const char *path)
|
||||||
{
|
{
|
||||||
SDL_RWops *ops = SDL_AllocRW();
|
SDL_RWops *ops = SDL_AllocRW();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
shState->fileSystem().openRead(*ops, path);
|
shState->fileSystem().openRead(*ops, path);
|
||||||
|
}
|
||||||
|
catch (const Exception &e)
|
||||||
|
{
|
||||||
|
SDL_FreeRW(ops);
|
||||||
|
raiseRbExc(e);
|
||||||
|
}
|
||||||
|
|
||||||
VALUE klass = rb_const_get(rb_cObject, rb_intern("FileInt"));
|
VALUE klass = rb_const_get(rb_cObject, rb_intern("FileInt"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue