diff --git a/src/app/gfx/snes_palette.cc b/src/app/gfx/snes_palette.cc index 53e72506..d82580ec 100644 --- a/src/app/gfx/snes_palette.cc +++ b/src/app/gfx/snes_palette.cc @@ -82,13 +82,13 @@ SNESPalette::SNESPalette(const std::vector & cols) { } char* SNESPalette::encode() { - char* data = new char[size_ * 2]; + auto data = std::make_shared(size_ * 2); for (unsigned int i = 0; i < size_; i++) { std::cout << colors[i].snes << std::endl; data[i * 2] = (char)(colors[i].snes & 0xFF); data[i * 2 + 1] = (char)(colors[i].snes >> 8); } - return data; + return data.get(); } SDL_Palette* SNESPalette::GetSDL_Palette() {