diff --git a/README.md b/README.md index 4a0fcfc1..01c1d136 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ If a requested font is not found, no error is generated. Instead, a built-in fon Win32API exists in mkxp-z, objectively functioning nearly the same as before for better or worse. The third and fourth arguments are now optional (if you just want a function that takes no arguments and returns nothing, for instance), and Win32API objects will yield themselves to any blocks given to `initialize`. -However, the Win32API class is also avaiable when built for Linux and macOS, under the name `MiniFFI` instead (Win32API is just an extra name for it in Windows). It will only load shared libraries built for your platform. +However, the Win32API class is also available when built for Linux and macOS, under the name `MiniFFI` instead (Win32API is just an extra name for it in Windows). It will only load shared libraries built for your platform. Being simple as it is, it remains mostly as the lazy option/last resort if you can't/don't want to build MKXP yourself. diff --git a/binding/binding-util.h b/binding/binding-util.h index ae37c3e1..b7ee7ab3 100644 --- a/binding/binding-util.h +++ b/binding/binding-util.h @@ -393,8 +393,7 @@ rb_str_catf(VALUE obj, const char *fmt, ...) static inline VALUE rb_file_open_str(VALUE filename, const char *mode) { - VALUE fileobj = rb_const_get(rb_cObject, rb_intern("File")); - return rb_funcall(fileobj, rb_intern("open"), 2, filename, rb_str_new2(mode)); + return rb_funcall(rb_cFile, rb_intern("open"), 2, filename, rb_str_new2(mode)); } #endif diff --git a/src/filesystem.cpp b/src/filesystem.cpp index 6f848f14..ca345054 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -732,6 +732,7 @@ char* FileSystem::normalize(const char *pathname, bool preferred, bool absolute) } cwk_path_normalize((path_abs) ? path_abs : (char*)pathname, path_nml, 512); + if (path_abs) delete path_abs; Debug() << pathname << ":" << path_nml; return path_nml; }