SDK/BaseWidget: Fix possible crash when disabling background

This commit is contained in:
Lynix 2019-06-13 19:06:09 +02:00
parent 29718db085
commit 6e7fd326db
2 changed files with 3 additions and 1 deletions

View File

@ -266,6 +266,7 @@ Nazara Development Kit:
- Fixed a subtle bug regarding entities invalidation and kill (ex: if an entity #2 kills entity #1 during Entity::Destroy callbacks, entity #1 will survive destruction).
- Added PhysicsSystem2D::[RaycastQuery, RegionQuery] overloads taking a callback
- Added TextAreaWidget support for outline
- Fixed possible crash when disabling BaseWidget background
# 0.4:

View File

@ -89,6 +89,7 @@ namespace Ndk
}
else
{
DestroyEntity(m_backgroundEntity);
m_backgroundEntity.Reset();
m_backgroundSprite.Reset();
}
@ -185,7 +186,7 @@ namespace Ndk
void BaseWidget::Layout()
{
if (m_backgroundEntity)
if (m_backgroundSprite)
m_backgroundSprite->SetSize(m_size.x, m_size.y);
UpdatePositionAndSize();