Skip to content

Commit

Permalink
(#3729): when an exception is thrown during render, we no longer cras…
Browse files Browse the repository at this point in the history
…h the compositor
  • Loading branch information
mattkae committed Feb 10, 2025
1 parent 473cc62 commit 6ff4ff9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/server/compositor/default_display_buffer_compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "mir/graphics/platform.h"
#include "mir/compositor/buffer_stream.h"
#include "mir/renderer/renderer.h"
#include "mir/log.h"
#include "occlusion.h"

namespace mc = mir::compositor;
Expand Down Expand Up @@ -118,7 +119,16 @@ bool mc::DefaultDisplayBufferCompositor::composite(mc::SceneElementSequence&& sc
renderer->set_output_transform(display_sink.transformation());
renderer->set_viewport(view_area);

display_sink.set_next_image(renderer->render(renderable_list));
try
{
display_sink.set_next_image(renderer->render(renderable_list));
}
catch (std::exception const& e)
{
// An exception may be thrown by the underlying platform during render.
// While bad, we do not want this to crash the compositor entirely.
log(logging::Severity::error, MIR_LOG_COMPONENT, std::current_exception(), "Encountered exception while rendering");
}

report->renderables_in_frame(this, renderable_list);
report->rendered_frame(this);
Expand Down

0 comments on commit 6ff4ff9

Please sign in to comment.