[osg-users] Threads leakage with late use of osgViewer::setThreadingModel()

Jens Georg mail+osg at jensge.org
Wed Sep 30 02:08:20 PDT 2015


Hello list,

we are experiencing a situation on OSG 3.2.x on Linux where we are 
unable to
create new instances of osgViewer because pthread_create()
suddenly fails with ENOMEM.

Our investigation showed that this was due to calling
osgViewer::setThreadingModel(osgViewer::Viewer::SingleThreaded) after
osgViewer::realize() on a machine that has a default threading model
different to osgViewer::Viewer::SingleThreaded.

This caused the thread to be created, but not yet running and
thus not stopped and destroyed in osgViewer::setThreadingModel(), 
leaking
the thread's allocated memory.

Is it a known convention that one should not call setThreadingModel()
after realize() or did we hit a bug?



More information about the osg-users mailing list