Removed usaged of throw and catch to enable better compatibility with embedded systems that don't support C++ exceptions efficiently.
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include <OpenThreads/ScopedLock>
|
||||
#include <OpenThreads/Mutex>
|
||||
|
||||
// #define CHECK_CONSISTENCY
|
||||
|
||||
using namespace osg;
|
||||
|
||||
// static cache of deleted buffer object lists which can only
|
||||
@@ -456,8 +458,9 @@ GLBufferObjectSet::~GLBufferObjectSet()
|
||||
|
||||
bool GLBufferObjectSet::checkConsistency() const
|
||||
{
|
||||
#ifndef CHECK_CONSISTENCY
|
||||
return true;
|
||||
|
||||
#else
|
||||
// osg::notify(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency()"<<std::endl;
|
||||
// check consistency of linked list.
|
||||
unsigned int numInList = 0;
|
||||
@@ -470,16 +473,16 @@ bool GLBufferObjectSet::checkConsistency() const
|
||||
{
|
||||
if ((to->_next)->_previous != to)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Error (to->_next)->_previous != to "<<std::endl;
|
||||
throw "Error (to->_next)->_previous != to ";
|
||||
osg::notify(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency() : Error (to->_next)->_previous != to "<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_tail != to)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Error _trail != to"<<std::endl;
|
||||
throw "Error _trail != to";
|
||||
osg::notify(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency() : Error _trail != to"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,6 +501,7 @@ bool GLBufferObjectSet::checkConsistency() const
|
||||
}
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLBufferObjectSet::handlePendingOrphandedGLBufferObjects()
|
||||
|
||||
@@ -659,7 +659,7 @@ void Image::allocateImage(int s,int t,int r,
|
||||
else
|
||||
{
|
||||
|
||||
// throw exception?? not for now, will simply set values to 0.
|
||||
// failed to allocate memory, for now, will simply set values to 0.
|
||||
_s = 0;
|
||||
_t = 0;
|
||||
_r = 0;
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
|
||||
// #define DO_TIMING
|
||||
|
||||
#define CHECK_CONSISTENCY
|
||||
|
||||
namespace osg {
|
||||
|
||||
ApplicationUsageProxy Texture_e0(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_TEXTURE_SIZE","Set the maximum size of textures.");
|
||||
@@ -169,8 +171,9 @@ Texture::TextureObjectSet::~TextureObjectSet()
|
||||
|
||||
bool Texture::TextureObjectSet::checkConsistency() const
|
||||
{
|
||||
// return true;
|
||||
|
||||
#ifndef CHECK_CONSISTENCY
|
||||
return true;
|
||||
#else
|
||||
// osg::notify(osg::NOTICE)<<"TextureObjectSet::checkConsistency()"<<std::endl;
|
||||
// check consistency of linked list.
|
||||
unsigned int numInList = 0;
|
||||
@@ -183,16 +186,16 @@ bool Texture::TextureObjectSet::checkConsistency() const
|
||||
{
|
||||
if ((to->_next)->_previous != to)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Error (to->_next)->_previous != to "<<std::endl;
|
||||
throw "Error (to->_next)->_previous != to ";
|
||||
osg::notify(osg::NOTICE)<<"Texture::TextureObjectSet::checkConsistency() : Error (to->_next)->_previous != to "<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_tail != to)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Error _trail != to"<<std::endl;
|
||||
throw "Error _trail != to";
|
||||
osg::notify(osg::NOTICE)<<"Texture::TextureObjectSet::checkConsistency() : Error _trail != to"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,6 +214,7 @@ bool Texture::TextureObjectSet::checkConsistency() const
|
||||
}
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Texture::TextureObjectSet::handlePendingOrphandedTextureObjects()
|
||||
|
||||
Reference in New Issue
Block a user