in the case of errors, close the opened components if and only if the whole opening process complete succesfully. This commit was SVN r21752.
Jeff will update the build system later to remove the C++ checks per the above caveat. This commit was SVN r21568.