1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-04 06:45:45 +02:00

previewrenderer: disconnect signals on destroy

also fix some build warnings

Change-Id: Ibbf2e28cb64800e65b8712c6d733aea9aa69c916
GitLab: #356
This commit is contained in:
Sébastien Blin 2021-03-30 15:19:46 -04:00
parent 525d9c4c05
commit 6a77a27cdc
2 changed files with 10 additions and 4 deletions

View file

@ -117,13 +117,16 @@ PhotoboothPreviewRender::PhotoboothPreviewRender(QQuickItem* parent)
{ {
connect(this, &PreviewRenderer::lrcInstanceChanged, [this] { connect(this, &PreviewRenderer::lrcInstanceChanged, [this] {
if (lrcInstance_) if (lrcInstance_)
connect(lrcInstance_->renderer(), &RenderManager::previewRenderingStopped, [this]() { rendererStoppedConnection_ = connect(lrcInstance_->renderer(),
Q_EMIT hideBooth(); &RenderManager::previewRenderingStopped,
}); [this]() { Q_EMIT hideBooth(); });
}); });
} }
PhotoboothPreviewRender::~PhotoboothPreviewRender() {} PhotoboothPreviewRender::~PhotoboothPreviewRender()
{
disconnect(rendererStoppedConnection_);
}
QString QString
PhotoboothPreviewRender::takePhoto(int size) PhotoboothPreviewRender::takePhoto(int size)
@ -133,6 +136,7 @@ PhotoboothPreviewRender::takePhoto(int size)
previewImage->copy() previewImage->copy()
.scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation))); .scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)));
} }
return {};
} }
void void

View file

@ -82,4 +82,6 @@ Q_SIGNALS:
private: private:
void paint(QPainter* painter) override final; void paint(QPainter* painter) override final;
QMetaObject::Connection rendererStoppedConnection_;
}; };