So we know that A::a is GC’d, because it is a UPROJECT, and it will be null “automatically” after garbage collection. So we can test it for null directly (it’s basically a shared_ptr, and not a C++ style ptr). I guess I should add ‘right?’
But I guess my real question is, does B::b, since it points to a UPROPERTY, get the UPROPERTY characteristics, and contribute to the lifetime of the same UObject that A::a points to (thus a shared_ptr), and can be tested null in this case (non dangling)…
Does it NOT contribute to the lifetime of A::a’s UObject, but gets set to null automatically (acts like a weak_ptr)…
Or, is it a dangling pointer, like any good pointer should be
My guess, at this point and with this feedback is that A::a acts like a shared_ptr, but B::b acts like a C++ style ptr. But I see so little weak_ptrs in examples, and in our code, with no error conditions. This experience could just be situational to the code I have seen, but still wrong, of course. And then this would explain why WeakObjectPtr even exists.