Skip to content
Snippets Groups Projects
Commit 6a77a27c authored by Sébastien Blin's avatar Sébastien Blin
Browse files

previewrenderer: disconnect signals on destroy

also fix some build warnings

Change-Id: Ibbf2e28cb64800e65b8712c6d733aea9aa69c916
GitLab: #356
parent 525d9c4c
No related branches found
No related tags found
No related merge requests found
......@@ -117,13 +117,16 @@ PhotoboothPreviewRender::PhotoboothPreviewRender(QQuickItem* parent)
{
connect(this, &PreviewRenderer::lrcInstanceChanged, [this] {
if (lrcInstance_)
connect(lrcInstance_->renderer(), &RenderManager::previewRenderingStopped, [this]() {
Q_EMIT hideBooth();
});
rendererStoppedConnection_ = connect(lrcInstance_->renderer(),
&RenderManager::previewRenderingStopped,
[this]() { Q_EMIT hideBooth(); });
});
}
PhotoboothPreviewRender::~PhotoboothPreviewRender() {}
PhotoboothPreviewRender::~PhotoboothPreviewRender()
{
disconnect(rendererStoppedConnection_);
}
QString
PhotoboothPreviewRender::takePhoto(int size)
......@@ -133,6 +136,7 @@ PhotoboothPreviewRender::takePhoto(int size)
previewImage->copy()
.scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)));
}
return {};
}
void
......
......@@ -82,4 +82,6 @@ Q_SIGNALS:
private:
void paint(QPainter* painter) override final;
QMetaObject::Connection rendererStoppedConnection_;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment