From c7bdb4ae1bbec45684cf0624f2b7d3e7b2e84715 Mon Sep 17 00:00:00 2001 From: enn0x Date: Thu, 25 Mar 2010 21:35:41 +0000 Subject: [PATCH] PhysxManager.get_global_ptr now returns NULL is SDK initialization fails. --- panda/src/physx/physxManager.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/panda/src/physx/physxManager.cxx b/panda/src/physx/physxManager.cxx index fb2f2ce24b..ceee12afb5 100644 --- a/panda/src/physx/physxManager.cxx +++ b/panda/src/physx/physxManager.cxx @@ -40,6 +40,7 @@ PhysxManager() { else { physx_cat.error() << "Error when setting up the PhysX subsystem: " << get_sdk_error_string(error) << endl; + _sdk = NULL; } nassertv_always(error == NXCE_NO_ERROR); @@ -106,7 +107,12 @@ get_global_ptr() { _global_ptr = new PhysxManager; } - return _global_ptr; + if (_global_ptr->_sdk == NULL) { + return NULL; + } + else { + return _global_ptr; + } } ////////////////////////////////////////////////////////////////////