Use-after-free bugs are pretty easy to figure out on shutdown because you can free the remainder of your working memory and if it turns out that you have a use-after-free there likely will be a double free in there somewhere.
If not then the problem is more insidious but I've found plenty of use-after-free bugs that way.