Although the pointers were set to null after the objects are destroyed, if for another reason the objects were destroyed (or never constructed and the pointers were not initialized), using a weak pointer can prevent unintentionally dereferencing dangling pointers.
Close #29105.
Request review @chub.
VideoLAN code repository instance