No.
> After you lock the weak_ptr to use the object,
> the object could be destructed and you're left with a dangling shared_ptr.
You can check in destructor of X that 'this_.use_count() == 1' if you feel worried.
When it is not then there is apparent logic defect somewhere and so X may blow
up the application with message suggesting to fix the defect ASAP.