Fix crash if CustomPaintWidget is destroyed with paint mid-flight

This commit is contained in:
baldurk
2020-05-16 12:17:55 +01:00
parent 2669c1e8bb
commit 284dbe7d79
+7 -1
View File
@@ -92,7 +92,13 @@ void CustomPaintWidget::paintEvent(QPaintEvent *e)
if(m_Ctx)
{
if(m_Output != NULL)
m_Ctx->Replay().AsyncInvoke(m_Tag, [this](IReplayController *r) { m_Output->Display(); });
{
QPointer<CustomPaintWidget> me(this);
m_Ctx->Replay().AsyncInvoke(m_Tag, [me](IReplayController *r) {
if(me && me->m_Output)
me->m_Output->Display();
});
}
}
else if(m_Dark == m_Light)
{