Clear selection cursor/eraser brush edges when closing the Editor (fix #4922)

This is a special case where the cursor was still visible on the
screen (the UILayer on the Display) and the Editor/Doc was closed
without any confirmation. So we have to explicitly hide/remove the
UILayer from the Display when the BrushPreview is destroyed.
This commit is contained in:
David Capello 2025-01-09 12:01:33 -03:00
parent 8e3d15584c
commit f46ff23b89

View File

@ -112,6 +112,13 @@ BrushPreview::BrushPreview(Editor* editor) : m_editor(editor)
BrushPreview::~BrushPreview()
{
if (m_onScreen) {
// Called mainly to remove the UILayer from the Display. If we
// don't explicitly call Display::removeLayer(), the m_uiLayer
// instance will be referenced by the Display until it's destroyed
// (keeping the UILayer alive and visible for the whole program).
hide();
}
}
BrushRef BrushPreview::getCurrentBrush()