HI Michael,

There a range of reasons why the OSG uses static for different places,
it won't be possible to remove these without breaking lots of
functionality, OSG API's and end user application usage.  So it's far
from trival task with a dubious end value ended.

Robert.

On 5 July 2012 13:20, michael kapelko <[email protected]> wrote:
> Hi.
>
> I'm trying to build OSG into my application. I've started with OSG logging.
> I've attached sample code that depicts the problem.
> After you run the program and than stop it by pressing ESC, you can
> see the following output:
>
> $ ./test
> abc
> DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
> DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
> DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
> DatabasePager::RequestQueue::~RequestQueue() Destructing queue.
> ~RegisterWindowingSystemInterfaceProxy()
> GraphicsContext::setWindowingSystemInterface() 0        0x7ffd0fd71470
>
> abc is printed after all delete operators take place. Somehow Viewer
> is deleted after I actually delete it.
>
> ~RegisterWindowingSystemInterfaceProxy() comes from the destruction of
> this static variable:
> http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowX11.cpp?rev=12923#L2137
>
> GraphicsContext::setWindowingSystemInterface() 0        0x7ffd0fd71470 comes
> from the destructor of the above variable:
> http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowX11.cpp?rev=12923#L2132
>
> This means OSG uses static variables which initialization and
> deinitialization times are unknown, which results in:
> 1) I can't really control my OSG logger lifetime;
> 2) I miss RegisterWindowingSystemInterfaceProxy() initialization in
> logger (and possibly many others).
> The only option is to create Logger specifically for OSG and let it
> die at an unknown time (after all my cleanup procedures), possibly
> causing me problems later.
>
> Can we please make it non-static?
>
> _______________________________________________
> 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