From 061be3d084dda89c5f312f2c7413fdbff18dae23 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 19 Jun 2008 11:58:34 +0000 Subject: [PATCH] In Program::PerContextProgram changed const Uniform* to osg::ref_ptr to avoid the possibility of a uniform being deleted and another being created and assigned at the same address which previously confused the uniform tracking code and introduced a bug. --- include/osg/Program | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/osg/Program b/include/osg/Program index a6e2abc94..409d29a50 100644 --- a/include/osg/Program +++ b/include/osg/Program @@ -188,7 +188,7 @@ class OSG_EXPORT Program : public osg::StateAttribute if (location>=0) { if ((unsigned int)location>=_lastAppliedUniformList.size()) _lastAppliedUniformList.resize(location+1); - const Uniform* lastAppliedUniform = _lastAppliedUniformList[location].first; + const Uniform* lastAppliedUniform = _lastAppliedUniformList[location].first.get(); if (lastAppliedUniform != &uniform) { // new attribute @@ -241,7 +241,7 @@ class OSG_EXPORT Program : public osg::StateAttribute ActiveVarInfoMap _uniformInfoMap; ActiveVarInfoMap _attribInfoMap; - typedef std::pair UniformModifiedCountPair; + typedef std::pair, unsigned int> UniformModifiedCountPair; typedef std::vector LastAppliedUniformList; mutable LastAppliedUniformList _lastAppliedUniformList;