Hi Brett,

You really should learn to use ref_ptr<>'s, manually deleting ref
counting objects is dangerous and only possible Viewer as I haven't
put the destructor private to allow one to construct the Viewer on the
stack for convenience, not to allow delete...

That sermon aside, could you please try your example with svn/trunk or 2.9.6.

Thanks,
Robert.



On Wed, Jan 20, 2010 at 8:25 PM, Brett Wiesner <[email protected]> wrote:
> Robert,
>
> Here is a sample program that crashes when loading earth.ive the second
> time. I'm using OSG 2.8.2.
>
> Thanks,
> Brett
>
>  main()
>  {
>
>     std::string modelPath = "earth.ive";
>
>     // create a scene graph (and keep it around).
>     osg::ref_ptr<osg::Node> modelNode = osgDB::readNodeFile(modelPath);
>
>     // create viewer1 and set the scene graph data.
>     osgViewer::Viewer* viewer1 = new osgViewer::Viewer;
>     viewer1->setUpViewOnSingleScreen(0);
>     viewer1->setSceneData(modelNode.get());
>     viewer1->setCameraManipulator(new osgGA::TrackballManipulator());
>
>     // render a frame
>     viewer1->realize();
>     while(!viewer1->done())
>     {
>        viewer1->frame();
>     }
>
>     // delete viewer1.
>     delete viewer1;
>     viewer1 = 0;
>
>     // create viewer2 and set the scene graph data.
>
>     osgViewer::Viewer* viewer2 = new osgViewer::Viewer;
>     viewer2->setUpViewOnSingleScreen(0);
>     viewer2->setSceneData(modelNode.get());
>     viewer2->setCameraManipulator(new osgGA::TrackballManipulator());
>
>     // render a frame
>     viewer2->realize();
>
>     while(!viewer2->done())
>     {
>        viewer2->frame();
>     }
>
>     // check that it has textures.
>
>     // delete viewer2.
>     delete viewer2;
>     viewer2 = 0;
>
>  }
>
> Robert Osfield wrote:
>>
>> Hi Colin,
>>
>> You make no mention of which version of the OSG you are using.  The
>> DatabasePager and manage of GL objects when destroying contexts has
>> improved significantly over the past year so the problems you are
>> seeing may well be already resolved.
>>
>> Robert.
>>
>> On Thu, Jan 14, 2010 at 5:00 PM, Colin Branch <[email protected]> wrote:
>>
>>>
>>> Greetings,
>>>
>>> Here's my steps:
>>> I'm creating a compositeViewer with one or more views.
>>> I'm loading a paged database.
>>> While the database is paging, I delete the compositeViewer (thus taking
>>> the
>>> context down with it as well as the database pager).
>>> I then create a new compositeViewer and attempt to render the sane
>>> database
>>> (same nodes).
>>> I'm getting a crash in the database pager, specifically it crash in the
>>> requestNodeFile function due to crashing on accessing invalid memory.
>>>
>>> The problem seems to step from the PagedLOD having a ref_ptr to a
>>> DatabasePager::DatabaseRequest.
>>> The databaseRequest has a raw pointer to a RequestQueue.
>>> The RequestQueue is invalid (as it is a referenced member of the original
>>> database pager, and thus is already deleted, but the DB request stayed
>>> alive).
>>> There appears to be no way of clearing the databaseRequest which is
>>> referenced in the PagedLOD node.
>>>
>>> This appears to be a problem with how OSG handles database paging,
>>> probably
>>> a bug. No obvious solution pops out, mainly due to the low level nature
>>> of
>>> the problem.
>>> This is an important issue since it affects one of our customers.
>>> I welcome any comments/suggestions/workarounds.
>>>
>>> Thank you and best regards,
>>> Colin Branch
>>>
>>> --
>>> Colin Branch
>>> VT MAK
>>> work: (617) 876-8085 Ext. 159
>>> email: [email protected]
>>>
>>> _______________________________________________
>>> osg-users mailing list
>>> [email protected]
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>>
>>
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to