Crash on Exit
Posted: Thu Mar 21, 2024 5:07 pm
So far things are going pretty great using citro2d.
The thing is when I press start to exit my program I always crash my 3DS system...
Main.c has this in the body of the loop....
My C2D_SpriteSheet are declared globally...
Then they are initialized in the main before the primary loop
Then I assign the values to my struct...
When I break the main loop the code that appears is...
Does anyone happen know where I am going wrong?
The thing is when I press start to exit my program I always crash my 3DS system...
Main.c has this in the body of the loop....
Code: Select all
// Respond to user input
u32 kDown = hidKeysDown();
if (kDown & KEY_START)
{
break; // break in order to return to hbmenu
}
Code: Select all
C2D_SpriteSheet GFX_1;
C2D_SpriteSheet GFX_2;
etc...
Then they are initialized in the main before the primary loop
Code: Select all
GFX_1=C2D_SpriteSheetLoad("romfs:/gfx/spriteAtlas1.t3x");
GFX_2=C2D_SpriteSheetLoad("romfs:/gfx/spriteAtlas2.t3x");
Code: Select all
entity[0].spritesheet = GFX_1;
entity[1].spritesheet = GFX_2;
Code: Select all
C2D_SpriteSheetFree(entity[0].spritesheet);
C2D_SpriteSheetFree(entity[1].spritesheet);
C2D_SpriteSheetFree(GFX_1);
C2D_SpriteSheetFree(GFX_2);
// Deinit libs
C2D_Fini();
C3D_Fini();
gfxExit();
romfsExit();
return 0;