chexiongsheng/puerts_unreal_demo

代理的内存泄露bug

Opened this issue · 0 comments

import * as UE from 'ue'
import {$ref, $unref, $set, argv, on, toManualReleaseDelegate, releaseManualReleaseDelegate} from 'puerts';

/////////////////////////////////////////////////////////////////////////
let world = (argv.getByName("GameInstance") as UE.GameInstance).GetWorld();
let actor = world.SpawnActor(UE.MainActor.StaticClass(), undefined, UE.ESpawnActorCollisionHandlingMethod.Undefined, undefined, undefined) as UE.MainActor;
function ggg(){
let arr = new Array(1000000);
function MutiCast2(i) {
if(arr){}
}
actor.NotifyWithInt.Add(MutiCast2)
actor.NotifyWithInt.Remove(MutiCast2);
}

for(let i=0;i<10;i++){
ggg()
}
actor = null