Object Pool and Weak Pointers

I’m implementing an Object Pool for my project but I’m having a hard time dealing with weak pointers as they will still valid even when the object is returned to its pool. For fixing that I was thinking about setting the RF_Unreachable flag in the GUObjectArray so the weak pointers would check and return nullptr.
Is there a less hacky way of doing it?