Fixed crash on exit issues with osgFX, osgParticle, osgSim and the osgforest example

This commit is contained in:
Robert Osfield
2019-01-07 17:46:02 +00:00
parent 5e9be10da6
commit 1c65815f4e
11 changed files with 150 additions and 16 deletions

View File

@@ -54,6 +54,11 @@ LightPointDrawable::LightPointDrawable(const LightPointDrawable& lpd,const osg::
{
}
LightPointDrawable::~LightPointDrawable()
{
OSG_NOTICE<<"LightPointDrawable::~LightPointDrawable()"<<std::endl;
}
void LightPointDrawable::reset()
{
SizedLightPointList::iterator itr;

View File

@@ -102,7 +102,7 @@ class OSGSIM_EXPORT LightPointDrawable : public osg::Drawable
protected:
virtual ~LightPointDrawable() {}
virtual ~LightPointDrawable();
osg::Endian _endian;

View File

@@ -93,6 +93,32 @@ void SphereSegment::traverse(osg::NodeVisitor& nv)
}
}
void SphereSegment::resizeGLObjectBuffers(unsigned int maxSize)
{
if (_surfaceGeometry.valid()) _surfaceGeometry->resizeGLObjectBuffers(maxSize);
if (_spokesGeometry.valid()) _spokesGeometry->resizeGLObjectBuffers(maxSize);
if (_edgeLineGeometry.valid()) _edgeLineGeometry->resizeGLObjectBuffers(maxSize);
if (_sidesGeometry.valid()) _sidesGeometry->resizeGLObjectBuffers(maxSize);
if (_litOpaqueState.valid()) _litOpaqueState->resizeGLObjectBuffers(maxSize);
if (_unlitOpaqueState.valid()) _unlitOpaqueState->resizeGLObjectBuffers(maxSize);
if (_litTransparentState.valid()) _litTransparentState->resizeGLObjectBuffers(maxSize);
if (_unlitTransparentState.valid()) _unlitTransparentState->resizeGLObjectBuffers(maxSize);
}
void SphereSegment::releaseGLObjects(osg::State* state) const
{
if (_surfaceGeometry.valid()) _surfaceGeometry->releaseGLObjects(state);
if (_spokesGeometry.valid()) _spokesGeometry->releaseGLObjects(state);
if (_edgeLineGeometry.valid()) _edgeLineGeometry->releaseGLObjects(state);
if (_sidesGeometry.valid()) _sidesGeometry->releaseGLObjects(state);
if (_litOpaqueState.valid()) _litOpaqueState->releaseGLObjects(state);
if (_unlitOpaqueState.valid()) _unlitOpaqueState->releaseGLObjects(state);
if (_litTransparentState.valid()) _litTransparentState->releaseGLObjects(state);
if (_unlitTransparentState.valid()) _unlitTransparentState->releaseGLObjects(state);
}
osg::BoundingSphere SphereSegment::computeBound() const
{
_bbox.init();