Skip to content

Commit

Permalink
cube: release framebuffers on deactivate (#2060)
Browse files Browse the repository at this point in the history
Currently it looks like the framebuffers are allocated on
activate but never released. This causes a substantial memory
leak. Fix this by adding a destructor to cube_render_instance_t
that releases them.

Fixes #2059
  • Loading branch information
lcolitti authored and ammen99 committed Mar 13, 2024
1 parent abd6c7d commit 6fcde52
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/cube/cube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ class wayfire_cube : public wf::per_output_plugin_instance_t, public wf::pointer
}
}

~cube_render_instance_t()
{
OpenGL::render_begin();
for (auto& buf : framebuffers)
{
buf.release();
}

OpenGL::render_end();
}

void schedule_instructions(
std::vector<wf::scene::render_instruction_t>& instructions,
const wf::render_target_t& target, wf::region_t& damage) override
Expand Down

0 comments on commit 6fcde52

Please sign in to comment.