I know that UPROPERTY Macro prevents UObject classes to release by GC. So UPROPERTY is strong reference.
And TWeakObjectPtr should use for preventing circular reference. So This is weak reference like its name.
I expected MyObject doesn’t GCed and can check validation by IsValid() Function just in case this object destroyed by another.
But when I had processed by this method, MyObject have GCed after about 45 secs from start.
And I obviously identified that it was destroyed by GC through GEngine->ForceGarbageCollection(true).
I think that TWeakObjectPtr invalidates the strong reference of UPROPERTY.
Then, Does UPROPERTY play role as just reflection to Unreal editor in there?
If so, Is there a method to do validation checking my UObject variable while keep UPROPERTY?
I thought TWeakObjectPtr is just Smart Pointer regardless of Unreal GC.
Why I hope to do validation checking by smart pointers rather than raw pointers is dangling pointer problem.
If UObject is destroyed in itself by ConditionalBeginDestroy function, the variable saving that’s pointer is invalidated but I can’t differentiate.
Perhaps the solution is to destroy the object explicitly by calling a destruction function and then initializing the variable to nullptr.