Fix crash when using ArBackgroundDrawable without setting an ar session
This commit is contained in:
@@ -46,7 +46,8 @@ namespace OpenVulkano::Scene
|
||||
|
||||
void ArBackgroundDrawable::Close()
|
||||
{
|
||||
m_arSession->OnNewFrame -= EventHandler(this, &ArBackgroundDrawable::OnNewArFrame);
|
||||
if (m_arSession) m_arSession->OnNewFrame -= EventHandler(this, &ArBackgroundDrawable::OnNewArFrame);
|
||||
m_arSession = nullptr;
|
||||
m_nextFrame = nullptr;
|
||||
Drawable::Close();
|
||||
}
|
||||
@@ -70,4 +71,4 @@ namespace OpenVulkano::Scene
|
||||
}
|
||||
if (!m_texture) m_texture = &Texture::PLACEHOLDER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user