Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for mir_performance_tests failure due to not cleaning up our displays #3080

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/platforms/eglstream-kms/server/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ class DisplayBuffer
pending_flip = satisfied_promise.get_future();
}

~DisplayBuffer()
{
if (output_stream != EGL_NO_STREAM_KHR)
{
eglDestroyStreamKHR(dpy, output_stream);
output_stream = nullptr;
}

if (ctx != EGL_NO_CONTEXT)
{
eglDestroyContext(dpy, ctx);
ctx = nullptr;
}
}

mir::geometry::Rectangle view_area() const override
{
return view_area_;
Expand Down
8 changes: 8 additions & 0 deletions src/platforms/eglstream-kms/server/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ mge::DisplayPlatform::DisplayPlatform(
provider = std::make_shared<InterfaceProvider>(display);
}

mge::DisplayPlatform::~DisplayPlatform()
{
if (display != EGL_NO_DISPLAY)
{
eglTerminate(display);
}
}

auto mge::DisplayPlatform::create_display(
std::shared_ptr<DisplayConfigurationPolicy> const& configuration_policy,
std::shared_ptr<GLConfig> const& gl_config)
Expand Down
2 changes: 2 additions & 0 deletions src/platforms/eglstream-kms/server/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class DisplayPlatform : public graphics::DisplayPlatform
EGLDeviceEXT device,
std::shared_ptr<DisplayReport> display_report);

~DisplayPlatform();

auto create_display(
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<GLConfig> const& gl_config)
Expand Down
Loading