Q: Crash on exiting application On this MFC application that embeds some old Crystal Reports viewer, on exit I get a crash 
(the instruction at ... referenced memory at ...; the value could not be "read"). 
Cannot run in debug mode since it only reproduces on a PC where no Visual Studio is installed, and I have no spare license to use.
I've added some logging and the FreeLibrary call to unload the u2dpost.dll fails (the handle became invalid somehow).
The crash appears to be in some code from the dll that fails to unload.
Can I force the unloading? I'm open to just avoiding the crash. 
Calling exit(0) (ugly as it is) still leads to the crash.
The address of the instruction is constant in relation to what report the application is opening.
On another PC (same XP SP3 operating system, same Crystal dlls, just Oracle 11g vs 10g), where debugging could be easy (Visual C++ is installed), the crash does not reproduce.
On the problem PC it happens all the time, if I start the export dialog (then close it or actually export, it makes no difference).
How can I proceed from here?
Edit:
I found a difference in this:
IDatabasePtr pDB = pRep->GetDatabase();
pDB->AddRef(); // with this line it crashes on an XP pc; without it it crashes on my Windows 7 workstation
(the Win & crash is on CCmdTarget::OnFinalRelease() last line: delete this;)
Any suggestions?

A: If it helps at all, I am facing the same problem with one of our legacy software.
I tested a debug version of my sw and used DebugDiag to capture the crash and it turned out that when (Release)ing some crystal reports interfaces (automatically by com destructor), it crashes.  So I wound up adding an additional AddRef to the problematic interface. Only when the version of windows is 7 or above.
