mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-20 22:09:55 +00:00
afg
This commit is contained in:
parent
cf058bd113
commit
9c9af253dc
2 changed files with 10 additions and 7 deletions
|
|
@ -594,3 +594,4 @@ static void mriBindingTerminate(){
|
|||
static void mriBindingReset(){
|
||||
rb_raise(getRbData()->exc[Reset], " ");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,11 @@
|
|||
#include <ruby.h>
|
||||
|
||||
static void fileIntFreeInstance(void *inst){
|
||||
SDL_IOStream *ops = static_cast<SDL_IOStream*>(inst);
|
||||
SDL_CloseIO(ops);
|
||||
SDL_IOStream *ops = static_cast<SDL_IOStream*>(inst);
|
||||
if (ops) {
|
||||
SDL_CloseIO(ops);
|
||||
}
|
||||
}
|
||||
|
||||
DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance);
|
||||
|
||||
static VALUE fileIntForPath(const char *path, bool rubyExc){
|
||||
|
|
@ -91,14 +92,15 @@ RB_METHOD(fileIntRead){
|
|||
}
|
||||
|
||||
RB_METHOD(fileIntClose){
|
||||
RB_UNUSED_PARAM;
|
||||
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
|
||||
RB_UNUSED_PARAM;
|
||||
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
|
||||
if (!ops){
|
||||
printf("NULL guard! fileIntClose broken!");
|
||||
return Qnil;
|
||||
}
|
||||
SDL_CloseIO(ops);
|
||||
return Qnil;
|
||||
SDL_CloseIO(ops);
|
||||
setPrivateData(self, nullptr);
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
RB_METHOD(fileIntGetByte){
|
||||
|
|
|
|||
Loading…
Reference in a new issue