Skip to content

Commit

Permalink
cube: release framebuffers on deactivate
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 committed Dec 8, 2023
1 parent 878c0a9 commit e638a73
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
}
}

virtual ~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 e638a73

Please sign in to comment.