I hit a crash when using some memory validation systems in the destructor of SMaterialDynamicParametersOverviewTreeItem related to NewDefaultValuePtr .
This pointer manages an array like so:
NewDefaultValuePtr = MakeUnique<uint8>(Property->GetSize());
However, I think this is going to invoke the wrong deleter when the destructor is called. I’m not really sure why this even compiles due to the UE_REQUIRES
on the array version of MakeUnique
, but it may be calling the Args&&
version instead - allocating a single uint8
and truncating the value from GetSize()
.
Should this line be
NewDefaultValuePtr = MakeUnique<uint8[]>(Property->GetSize());
instead? And the member variable changed to TUniquePtr<uint8[]>
?