ImGui_GM icon indicating copy to clipboard operation
ImGui_GM copied to clipboard

Destroying and reloading sprites when drawing them causes a crash

Open AlubJ opened this issue 5 months ago • 0 comments

I am making a font editor for a game, when reloading sprites it causes a crash when using ImGui.ImageButton.

After reloading, ImGui will try to render erroneous sprites, but uses the correct size from the correct sprite. I have double-checked my loading code, and the sprite references are correct.

image

Error:

___________________________________________
############################################################################################
ERROR in action number 1
of Draw Event for object ctrlUI:
sprite_get_texture argument 1 invalid reference to (sprite) - requested 5 max is 369
 at gml_Script___Render@anon@122190@ImGui@ImGui (line 4031) -                                                         tex_id = sprite_get_texture((tex_data >> 4) & 0xFF, tex_data >> 12);
############################################################################################
gml_Script___Render@anon@122190@ImGui@ImGui (line 4031)
gml_Object_ctrlUI_Draw_64 (line 19) - if (window_get_width() > 0 && window_get_height > 0) ImGui.__Render();

AlubJ avatar Sep 02 '24 18:09 AlubJ