Fixed crash which occurs when changing the material of an object twice in a row in the inspector #284
|
@ -66,10 +66,12 @@ namespace SHADE
|
|||
{
|
||||
oldMaterial = material;
|
||||
material = {};
|
||||
oldMatIsShared = false;
|
||||
}
|
||||
else if (sharedMaterial)
|
||||
{
|
||||
oldMaterial = sharedMaterial;
|
||||
oldMatIsShared = true;
|
||||
}
|
||||
|
||||
// Update the material
|
||||
|
@ -150,7 +152,7 @@ namespace SHADE
|
|||
{
|
||||
matChanged = false;
|
||||
meshChanged = false;
|
||||
if (oldMaterial)
|
||||
if (oldMaterial && !oldMatIsShared)
|
||||
oldMaterial.Free();
|
||||
oldMaterial = {};
|
||||
oldMesh = {};
|
||||
|
|
|
@ -90,6 +90,7 @@ namespace SHADE
|
|||
bool matChanged = true;
|
||||
Handle<SHMaterialInstance> oldMaterial;
|
||||
uint8_t lightLayer;
|
||||
bool oldMatIsShared = false;
|
||||
|
||||
RTTR_ENABLE()
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue