diff --git a/doomsday/apps/client/src/clientapp.cpp b/doomsday/apps/client/src/clientapp.cpp index a45bbd37cf..2b27a58d92 100644 --- a/doomsday/apps/client/src/clientapp.cpp +++ b/doomsday/apps/client/src/clientapp.cpp @@ -14,7 +14,7 @@ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. You should have received a copy of the GNU * General Public License along with this program; if not, see: - * http://www.gnu.org/licenses + * http://www.gnu.org/licenses */ #include "de_platform.h" @@ -119,7 +119,7 @@ DENG2_PIMPL(ClientApp) , DENG2_OBSERVES(Plugins, PublishAPI) , DENG2_OBSERVES(Plugins, Notification) , DENG2_OBSERVES(Games, Progress) -{ +{ Binder binder; QScopedPointer updater; BusyRunner busyRunner; @@ -219,12 +219,20 @@ DENG2_PIMPL(ClientApp) ~Instance() { - LogBuffer::get().removeSink(logAlarm); + try + { + LogBuffer::get().removeSink(logAlarm); - self.vr().oculusRift().deinit(); + self.vr().oculusRift().deinit(); - Sys_Shutdown(); - DD_Shutdown(); + Sys_Shutdown(); + DD_Shutdown(); + } + catch(Error const &er) + { + qWarning() << "Exception during ~ClientApp:" << er.asText(); + DENG2_ASSERT(!"Unclean shutdown: exception in ~ClientApp"); + } updater.reset(); delete worldSys; diff --git a/doomsday/apps/client/src/dd_main.cpp b/doomsday/apps/client/src/dd_main.cpp index 43b37e9b74..982e5c175d 100644 --- a/doomsday/apps/client/src/dd_main.cpp +++ b/doomsday/apps/client/src/dd_main.cpp @@ -573,7 +573,10 @@ ::audio::System &App_AudioSystem() if(App::appExists()) { #ifdef __CLIENT__ - return ClientApp::audioSystem(); + if(ClientApp::hasAudioSystem()) + { + return ClientApp::audioSystem(); + } #endif #ifdef __SERVER__ return ServerApp::audioSystem(); @@ -2392,7 +2395,7 @@ dint DD_GetInteger(dint ddvalue) case DD_USING_HEAD_TRACKING: return vrCfg().mode() == VRConfig::OculusRift && vrCfg().oculusRift().isReady(); #endif - + case DD_NUMMOBJTYPES: return ::defs.things.size(); @@ -2939,7 +2942,7 @@ D_CMD(Version) LOG_NOTE(_E(D) DOOMSDAY_NICENAME " " DOOMSDAY_VERSION_FULLTEXT); LOG_MSG(_E(l) "Homepage: " _E(.) _E(i) DOOMSDAY_HOMEURL _E(.) "\n" _E(l) "Project: " _E(.) _E(i) DENGPROJECT_HOMEURL); - + // Print the version info of the current game if loaded. if(App_GameLoaded()) {