[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19825] trunk/blender/source/gameengine/ VideoTexture: BGE VideoTexture: fix bug with VideoTexture.materialID() since recent commit.
Benoit Bolsee
benoit.bolsee at online.be
Mon Apr 20 23:20:33 CEST 2009
Revision: 19825
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19825
Author: ben2610
Date: 2009-04-20 23:20:33 +0200 (Mon, 20 Apr 2009)
Log Message:
-----------
BGE VideoTexture: fix bug with VideoTexture.materialID() since recent commit.
Modified Paths:
--------------
trunk/blender/source/gameengine/VideoTexture/BlendType.h
trunk/blender/source/gameengine/VideoTexture/Texture.cpp
Modified: trunk/blender/source/gameengine/VideoTexture/BlendType.h
===================================================================
--- trunk/blender/source/gameengine/VideoTexture/BlendType.h 2009-04-20 18:31:48 UTC (rev 19824)
+++ trunk/blender/source/gameengine/VideoTexture/BlendType.h 2009-04-20 21:20:33 UTC (rev 19825)
@@ -25,6 +25,7 @@
/// class allows check type of blender python object and access its contained object
+/// MUST ONLY BE USED FOR KX classes that are descendent of PyObjectPlus
template <class PyObj> class BlendType
{
public:
@@ -48,8 +49,9 @@
// if pointer to type is set and don't match to type of provided object, return NULL
else if (obj->ob_type != m_objType)
return NULL;
- // return pointer to object
- return (PyObj*)obj;
+ // return pointer to object, this class can only be used for KX object =>
+ // the Py object is actually a proxy
+ return (PyObj*)BGE_PROXY_REF(obj);
}
/// parse arguments to get object
Modified: trunk/blender/source/gameengine/VideoTexture/Texture.cpp
===================================================================
--- trunk/blender/source/gameengine/VideoTexture/Texture.cpp 2009-04-20 18:31:48 UTC (rev 19824)
+++ trunk/blender/source/gameengine/VideoTexture/Texture.cpp 2009-04-20 21:20:33 UTC (rev 19825)
@@ -163,7 +163,8 @@
// release renderer
Py_XDECREF(self->m_source);
// close texture
- Texture_close(self);
+ PyObject* ret = Texture_close(self);
+ Py_DECREF(ret);
// release scaled image buffer
delete [] self->m_scaledImg;
// release object
More information about the Bf-blender-cvs
mailing list