mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-31 13:50:48 +00:00
remove memory leak in A_ChangeModel
This commit is contained in:
parent
bc41356b35
commit
7dda6570ec
1 changed files with 2 additions and 5 deletions
|
@ -5155,13 +5155,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_ChangeModel)
|
|||
if (mobj->modelData == nullptr)
|
||||
{
|
||||
auto ptr = Create<DActorModelData>();
|
||||
|
||||
ptr->hasModel = mobj->hasmodel ? 1 : 0;
|
||||
ptr->modelIDs = *new TArray<int>();
|
||||
ptr->skinIDs = *new TArray<FTextureID>();
|
||||
ptr->surfaceSkinIDs = *new TArray<FTextureID>();
|
||||
ptr->animationIDs = *new TArray<int>();
|
||||
ptr->modelFrameGenerators = *new TArray<int>();
|
||||
ptr->modelDef = NAME_None;
|
||||
|
||||
mobj->modelData = ptr;
|
||||
mobj->hasmodel = 1;
|
||||
GC::WriteBarrier(mobj, ptr);
|
||||
|
|
Loading…
Reference in a new issue