diff options
| author | realtradam <[email protected]> | 2022-01-21 19:15:04 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-01-21 19:15:04 -0500 |
| commit | 363a6f056a95f1329d2ab6043b9246703ae30632 (patch) | |
| tree | 12ec5ccced794605e6be5390f5e0e1cec009f0e9 /src/raylib.c | |
| parent | b335e0711e4dc10027de89b364aeefe4c56c513e (diff) | |
| download | mruby-raylib-363a6f056a95f1329d2ab6043b9246703ae30632.tar.gz mruby-raylib-363a6f056a95f1329d2ab6043b9246703ae30632.zip | |
textures free correctly
Diffstat (limited to 'src/raylib.c')
| -rw-r--r-- | src/raylib.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/raylib.c b/src/raylib.c index 376ec50..0215fae 100644 --- a/src/raylib.c +++ b/src/raylib.c @@ -12,6 +12,7 @@ #if defined(PLATFORM_WEB) void execute_emscripten_block(void*); #endif +void helper_texture_free(mrb_state*, void*); bool check_collision_circle_rec(mrb_state* mrb, mrb_value circle_obj, mrb_value rect_obj); @@ -20,9 +21,16 @@ static const struct mrb_data_type Color_type = { }; static const struct mrb_data_type Texture_type = { - "Texture", mrb_free + "Texture", helper_texture_free }; +void +helper_texture_free(mrb_state* mrb, void*ptr) { + Texture *texture = (Texture*)ptr; + UnloadTexture(*texture); + mrb_free(mrb, ptr); +} + static const struct mrb_data_type Sound_type = { "Sound", mrb_free }; |
