Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NanovgSessoin : implement teardown()
Browse files Browse the repository at this point in the history
vinsentli committed Jan 5, 2025
1 parent 1cab233 commit 64f9697
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions shell/renderSessions/NanovgSession.cpp
Original file line number Diff line number Diff line change
@@ -183,4 +183,10 @@ void NanovgSession::drawNanovg(float framebuffferWidth,
updateGraph(&cpuGraph_, (end - start));
}

void NanovgSession::teardown() noexcept {
if (nvgContext_) {
iglu::nanovg::DestroyContext(nvgContext_);
}
}

} // namespace igl::shell
4 changes: 2 additions & 2 deletions shell/renderSessions/NanovgSession.h
Original file line number Diff line number Diff line change
@@ -52,10 +52,10 @@ class TouchListener : public ITouchListener {

class NanovgSession : public RenderSession {
public:
explicit NanovgSession(std::shared_ptr<Platform> platform) : RenderSession(std::move(platform)) {
}
explicit NanovgSession(std::shared_ptr<Platform> platform) : RenderSession(std::move(platform)) {}
void initialize() noexcept override;
void update(igl::SurfaceTextures surfaceTextures) noexcept override;
void teardown() noexcept override;

private:
void drawNanovg(float framebuffferWidth,

0 comments on commit 64f9697

Please sign in to comment.