Commit graph

23 commits

Author SHA1 Message Date
Wayward Heart
cf43cf005b Don't store Exception objects' messages on the stack. 2024-08-27 22:20:36 -05:00
Wayward Heart
130375b6d8 Properly handle uninitialized and reinitialized objects
In RGSS, uninitialized disposable objects (and Fonts, sort of) are technically disposed, and other objects (Tone, Color, Rect, and Table) are created with all values set to 0. It's also possible to reinitialize them, although reinitializing disposables leaks memory.

This commit causes MiniFFI and FileInt objects to improperly raise disposed errors if used while uninitialized, but that feels acceptable to me.
2024-08-02 09:26:51 -05:00
Wayward Heart
99ad4fa636 Throw exceptions for Resets and Exits instead of directly raising.
While this does close small memory leaks, this is mostly for threading reasons. We're not supposed to call rb_raise with the gvl released, and calling rb_raise prevents GFX_UNLOCK from being called, which would cause problems for any games that want to call graphical operations in multiple threads should the user reset.

We're also now calling Graphics.__reset__ and Audio.__reset__ via eval instead of directly calling the functions, in case a game wants to hook them.
2024-08-02 09:26:51 -05:00
Wayward Heart
a73f9ccc1f Prevent memory leaks from rb_raise
rb_raise calls longjmp, which bypasses C++ destructors, and also keeps the error for catch blocks from being unallocated if passed by reference, which we do for exceptions.

Some of the calls I left can still jump out of try blocks, which you're not supposed to do, but there shouldn't be any objects with destructors initialized at those points so it's probably fine.
2024-08-02 09:26:51 -05:00
Amaryllis Kulla
fae7fa9c4e
Update ancurio's copyright notice (#29) 2023-10-04 15:07:34 -04:00
Snowdream
a2f9eb08ad Actually bind Input::Controller.pressex? 2022-07-09 23:46:47 -04:00
Snowdream
bd075d62fe Older versions of Ruby 2 don't have rb_utf8_str_* 2022-07-09 19:29:08 -04:00
Struma
63b40053ac Prevent relevant functions from stepping over Graphics.update when threading 2021-06-04 14:29:45 -04:00
Struma
f3f401a794 set HTTP response body encoding based on Content-Type 2021-03-28 15:26:08 -04:00
Struma
db919e9f29 Make sure all Ruby strings are created as UTF-8 2021-03-02 03:26:51 -05:00
Struma
65c6c78936 Raise exception if getPrivateData fails 2021-02-02 06:21:25 -05:00
Struma
7db1c1219e Prefix mkxp-z preprocessor definitions with MKXPZ_ 2020-12-31 14:50:07 -05:00
Struma
bd549a65ad Support building with Ruby 1.9 2020-11-15 18:47:21 -05:00
Struma
c674864e53 Bump version to 1.2.1 2020-02-26 16:55:13 -05:00
Struma
655dc537f0 Make getPrivateDataCheck less strict 2020-02-26 16:50:53 -05:00
Struma
94e063c6c0 OLD_RUBY -> RAPI_MAJOR/RAPI_MINOR/RAPI_TEENY/RAPI_FULL 2020-02-26 12:44:37 -05:00
Struma
2a046a0709 Build with Ruby 2.7 2020-02-26 11:05:46 -05:00
Struma
0f767dbfe3 revert getPrivateDataCheck 2020-02-03 04:55:50 -05:00
Inori
a213b45e84 always use RGSS method of checking private data 2019-12-21 04:51:54 -05:00
Inori
11b6d2717f Typos, small corrections 2019-08-19 13:11:19 -04:00
Inori
18bd8084ec Use proper Ruby 1.8 header path 2019-08-01 14:55:45 -04:00
Inori
1bf83b0ca7 Make getPrivateDataCheck more accurate 2019-08-01 01:14:49 -04:00
Inori
7f3a548755 Remove mruby and null bindings 2019-07-31 08:47:44 -04:00
Renamed from binding-mri/binding-util.h (Browse further)