If you are using COM smart pointers and calling CoUninitialize before the smart pointer goes out of scope, you can see a similar issue.