backends/virtual: Manage VirtualQPainterLayer using std::unique_ptr

This commit is contained in:
Vlad Zahorodnii 2022-07-12 13:23:35 +03:00
parent 26d4a06818
commit 71bfbe815c
2 changed files with 3 additions and 3 deletions

View file

@ -61,12 +61,12 @@ VirtualQPainterBackend::~VirtualQPainterBackend() = default;
void VirtualQPainterBackend::addOutput(Output *output)
{
m_outputs.insert(output, std::make_shared<VirtualQPainterLayer>(output));
m_outputs[output] = std::make_unique<VirtualQPainterLayer>(output);
}
void VirtualQPainterBackend::removeOutput(Output *output)
{
m_outputs.remove(output);
m_outputs.erase(output);
}
void VirtualQPainterBackend::present(Output *output)

View file

@ -50,7 +50,7 @@ private:
void addOutput(Output *output);
void removeOutput(Output *output);
QMap<Output *, std::shared_ptr<VirtualQPainterLayer>> m_outputs;
std::map<Output *, std::unique_ptr<VirtualQPainterLayer>> m_outputs;
VirtualBackend *m_backend;
int m_frameCounter = 0;
};