We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6de3d02 + 1e96827 commit 8b42ba1Copy full SHA for 8b42ba1
src/Core/Context.cpp
@@ -163,6 +163,11 @@ std::shared_ptr<Context> Context::GetInstance() {
163
164
void Context::SetWindowIcon(const std::string &path) {
165
SDL_Surface *image = IMG_Load(path.c_str());
166
- SDL_SetWindowIcon(m_Window, image);
+ if (image) {
167
+ SDL_SetWindowIcon(m_Window, image);
168
+ SDL_FreeSurface(image);
169
+ return;
170
+ }
171
+ LOG_ERROR("Failed to load image: {}", path);
172
}
173
} // namespace Core
0 commit comments