Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-07-09 23:59:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-09 23:59:32 +0400
commit7370ba1839973010dd6e0ed0349c34477d8ece0a (patch)
tree31afe355c52ff2efb09842e5a117f82a8c7d5f66 /source/gameengine
parent65d1e27ff5b5d315a462c27d9e194561b78072ec (diff)
fix for NULL pointer usages
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp2
3 files changed, 4 insertions, 6 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 10906cdae02..3a25df73f9b 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -1147,7 +1147,7 @@ PyObject *PyObjectPlus::NewProxyPlus_Ext(PyObjectPlus *self, PyTypeObject *tp, v
BGE_PROXY_REF(proxy) = NULL;
BGE_PROXY_PTR(proxy) = ptr;
#ifdef USE_WEAKREFS
- BGE_PROXY_WKREF(self->m_proxy) = NULL;
+ BGE_PROXY_WKREF(proxy) = NULL;
#endif
return proxy;
}
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index 473ebbd74bf..c60c931c33b 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -1022,10 +1022,8 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay,
return NULL;
PyObject* argValue = PyTuple_New(2);
- if (argValue) {
- PyTuple_SET_ITEM(argValue, 0, PyFloat_FromDouble(x));
- PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(y));
- }
+ PyTuple_SET_ITEM(argValue, 0, PyFloat_FromDouble(x));
+ PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(y));
if(!PyVecTo(PygetScreenVect(argValue), vect))
{
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 47d83c16659..7ca8e7e3b52 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -327,7 +327,7 @@ void KX_GameObject::RemoveParent(KX_Scene *scene)
rootobj->m_pPhysicsController1->RemoveCompoundChild(m_pPhysicsController1);
}
m_pPhysicsController1->RestoreDynamics();
- if (m_pPhysicsController1->IsDyna() && rootobj->m_pPhysicsController1)
+ if (m_pPhysicsController1->IsDyna() && (rootobj != NULL && rootobj->m_pPhysicsController1))
{
// dynamic object should remember the velocity they had while being parented
MT_Point3 childPoint = GetSGNode()->GetWorldPosition();