3 ms·
> Guarding against it anyway is like guarding against someone passing a destroyed object to you - it just doesn't make sense to. It doesn’t make sense to do so
by gumby 2y ago
> Guarding against it anyway is like guarding against someone passing a destroyed object to you - it just doesn't make sense to.
It doesn’t make sense to do so intentionally, but that’s a classic dangling-pointer/use-after-free bug. In some contexts it might make sense to guard against it for the same reasons one may validate arguments passed to a public API (and then not in the internal code)