MCPcopy Create free account
hub / github.com/Tencent/UnLua / OnAsyncLoadingFlushUpdate

Method OnAsyncLoadingFlushUpdate

Plugins/UnLua/Source/UnLua/Private/LuaEnv.cpp:626–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624 }
625
626 void FLuaEnv::OnAsyncLoadingFlushUpdate()
627 {
628 TArray<FWeakObjectPtr> CandidatesTemp;
629 TArray<int> CandidatesRemovedIndexes;
630
631 TArray<UObject*> LocalCandidates;
632 {
633 {
634 FScopeLock Lock(&CandidatesLock);
635 CandidatesTemp.Append(Candidates);
636 }
637
638
639 for (int32 i = CandidatesTemp.Num() - 1; i >= 0; --i)
640 {
641 FWeakObjectPtr ObjectPtr = CandidatesTemp[i];
642 if (!ObjectPtr.IsValid())
643 {
644 // discard invalid objects
645 CandidatesRemovedIndexes.Add(i);
646 continue;
647 }
648
649 UObject* Object = ObjectPtr.Get();
650 if (Object->HasAnyFlags(RF_NeedPostLoad)
651 || Object->HasAnyInternalFlags(AsyncObjectFlags)
652 || Object->GetClass()->HasAnyInternalFlags(AsyncObjectFlags))
653 {
654 // delay bind on next update
655 continue;
656 }
657
658 LocalCandidates.Add(Object);
659 CandidatesRemovedIndexes.Add(i);
660 }
661 }
662
663 {
664 FScopeLock Lock(&CandidatesLock);
665 for (int32 j = 0; j < CandidatesRemovedIndexes.Num(); ++j)
666 {
667 Candidates.RemoveAt(CandidatesRemovedIndexes[j]);
668 }
669 }
670
671 for (int32 i = 0; i < LocalCandidates.Num(); ++i)
672 {
673 UObject* Object = LocalCandidates[i];
674 TryBind(Object);
675 }
676 }
677
678 FORCEINLINE void FLuaEnv::RegisterDelegates()
679 {

Callers

nothing calls this directly

Calls 5

AppendMethod · 0.45
NumMethod · 0.45
IsValidMethod · 0.45
AddMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected