Skip to content

Commit

Permalink
Do not leak Finally in App to satisfy clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Oct 29, 2024
1 parent 3e4523f commit 0b0c41b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ std::string App::getDisplayName() const {

void App::setDisplayName(const std::string& displayName) {
if (!impl) { // e.g. Android when using showWindow without jnglInit
new Finally(init({})); // leak
static Finally dummy(init({}));
}
impl->displayName = displayName;
}
Expand All @@ -105,7 +105,7 @@ void App::setPixelArt(const bool pixelArt) {

void App::registerShaderProgram(ShaderProgram* shaderProgram) {
if (!impl) { // unit tests
new Finally(init({})); // leak
static Finally dummy(init({}));
}
impl->shaderPrograms.insert(shaderProgram);
}
Expand Down
2 changes: 1 addition & 1 deletion src/sdl/sdl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SDL {
private:
SDL();
~SDL();
void setHint(const char* name, bool);
static void setHint(const char* name, bool);
};

} // namespace jngl

0 comments on commit 0b0c41b

Please sign in to comment.