rapiz1 / DungeonRush

👾🐍 A opensource game inspired by Snake, written in pure C with SDL
GNU General Public License v3.0
2k stars 294 forks source link

Game crash #28

Open Haceau-Zoac opened 3 years ago

Haceau-Zoac commented 3 years ago

Press ESC or close the game in multpayers / LAN / join a game to crash(dungeon_rush.exe 已停止工作) My system is window7

Haceau-Zoac commented 3 years ago

I found the problem because the destroyText function passed a null pointer Repair method: Add a null pointer detection to the function destroyText

void destroyText(Text* self) {
   if (self != NULL)
   {
     SDL_DestroyTexture(self->origin);
     free(self);
   }
}