I've been having this problem for a while and I'm hoping someone has some ideas to see what may be causing the problem - if it is an addon during unload or general system. It doesn't happen every time which is making troubleshooting a problem. Hoping for some sort of log that may tell me the answer.
When I Exit WoW I periodically get a freeze up and have to manually exit the app. Unfortunately this has been causing havok in my WTF directory and frequently I end up with corrupted SavedVariables. Different addons' saved vars have been destroyed - it has happened to my Pitbull4, Auctioneer, Grid, etc.
Is there any way to get a clearer indication of what is happening here?
I used to get things like this when I had stupidly set Recount to record maximum data about every fight, not just boss. Needless to say, logging out took a while, to the point that things would completely freeze. In fact, had I waited (several minutes!), it would have eventually exited (and caused an error next time I logged on, but that's another matter). So do you have an addon saving ungodly amounts of data on exit?
On the other hand, it could be something totally unrelated that freezes your computer and it happens at the wrong time?
I've learned the hard way to back up my WTF folder.
I had a problem a quite awhile ago that on exit I would get an exception, this caused all saved var files that were open during the exception to have an extra CR LF at the first line...though I have been told this shouldn't have caused a problem upon restarting the game those saved var files where reported as corrupt and removed leaving me with new blank saved vars.
So myself and a friend created a AU3 script to backup the WTF folder, parse each .lua file and remove the offending CR LF from the beginning of each file that contained it.
I don't know if this is what is causing your problem or if anyone has even had a problem such as mine, but if you would like I could attach the AU3 file upon request.
So do you have an addon saving ungodly amounts of data on exit?
This has always turned out to be the cause any time I've had crashes on exiting the game. Open your saved variables folder and see which addons are creating huge files. Log in with those addons disabled, and see if you still crash when exiting. Assuming there isn't a physical problem with your hard drive, I suspect you won't crash.