Hi Vincent,

What exactly do you mean by "when I use the other way and call the
destructor (I clear the viewer map I get) there is a crash in", as
these seems odd, you never call the destructor, all you can do is call
delete, but in the case of the Viewer class you should never be
calling delete yourself, rather leave it to C++ to clean up in the
case of creating the Viewer in local scope on the stack, or using a
ref_ptr<> when you manage the Viewer on the heap.

Robert.

On Thu, Jun 25, 2009 at 12:30 PM, Vincent
Bourdier<vincent.bourd...@gmail.com> wrote:
> Hi all,
>
> I have a crash on a composite viewer destructor, and I do not see anything
> strange or wrong in my code.
>
> My viewer is managed as an external lib, and the frame() call are done by a
> method, like the close() call to finish a viewer.
>
> So, if I use the viewer->run() there is no problem, but when I use the other
> way and call the destructor (I clear the viewer map I get) there is a crash
> in
>
> GLObjects.cpp :
>
> void osg::flushAllDeletedGLObjects(unsigned int contextID)
> {
>     double currentTime = DBL_MAX;
>     double availableTime = DBL_MAX;
>
> osg::BufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
>     osg::Drawable::flushAllDeletedDisplayLists(contextID);
>
> osg::FragmentProgram::flushDeletedFragmentProgramObjects(contextID,currentTime,availableTime);
>
> osg::FrameBufferObject::flushDeletedFrameBufferObjects(contextID,currentTime,availableTime);
>
> //osg::Program::flushDeletedGlPrograms(contextID,currentTime,availableTime);
> //CRASH Here
>
> osg::RenderBuffer::flushDeletedRenderBuffers(contextID,currentTime,availableTime);
>
> //osg::Shader::flushDeletedGlShaders(contextID,currentTime,availableTime);
> //CRASH Here
>     osg::Texture::flushAllDeletedTextureObjects(contextID);
>
> osg::VertexProgram::flushDeletedVertexProgramObjects(contextID,currentTime,availableTime);
>
> osg::OcclusionQueryNode::flushDeletedQueryObjects(contextID,currentTime,availableTime);
>
> }
>
> in DEBUG_INFO I get :
> ...
> Releasing GL objects for Camera=05EAE0C8 _state=05EB7050
> Closing still viable window 0 _state->getContextID()=0
> Doing Flush
> GraphicsContext::setWindowingSystemInterface() 00000000    05DE9198
>
> Any idea ? suggestion ?
>
> Thanks a lot.
>
> Regards,
>    Vincent.
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to