MRI: load_data: Catch exceptions and pass onto ruby
This commit is contained in:
		
							parent
							
								
									05041fdb03
								
							
						
					
					
						commit
						3a29385df0
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		| 
						 | 
					@ -43,7 +43,16 @@ static VALUE
 | 
				
			||||||
fileIntForPath(const char *path)
 | 
					fileIntForPath(const char *path)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SDL_RWops *ops = SDL_AllocRW();
 | 
						SDL_RWops *ops = SDL_AllocRW();
 | 
				
			||||||
	shState->fileSystem().openRead(*ops, path);
 | 
					
 | 
				
			||||||
 | 
						try
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							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…
	
	Add table
		Add a link
		
	
		Reference in a new issue