<div dir="ltr"><div><div><div>Hello Robert,<br><br></div>It is working fine now, I tested it on Linux and Windows.<br><br></div>Thanks!<br></div>David<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 5, 2015 at 12:48 PM, Robert Osfield <span dir="ltr"><<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi David,<br><div class="gmail_extra"><br></div><div class="gmail_extra">I have removed the InitRegistry proxy object from src/osgViewer/ViewerBase.cpp and introduced OSG_INIT_SINGLETON_PROXY usage in DatabasePager.cpp and Registry.cpp which should ensure that the singleton's are initialized in a single threaded way and destructed in an appropriate order. I have checked this change into svn/trunk and the OSG-3.4 branch. Changes are:<br><br>Index: src/osgDB/DatabasePager.cpp<br>===================================================================<br>--- src/osgDB/DatabasePager.cpp (revision 15130)<br>+++ src/osgDB/DatabasePager.cpp (working copy)<br>@@ -1236,6 +1236,8 @@<br> return s_DatabasePager;<br> }<br> <br>+OSG_INIT_SINGLETON_PROXY(ProxyInitDatabasePager, DatabasePager::prototype())<br>+<br> DatabasePager* DatabasePager::create()<br> {<br> return DatabasePager::prototype().valid() ?<br>Index: src/osgDB/Registry.cpp<br>===================================================================<br>--- src/osgDB/Registry.cpp (revision 15130)<br>+++ src/osgDB/Registry.cpp (working copy)<br>@@ -214,7 +214,9 @@<br> return s_registry.get(); // will return NULL on erase<br> }<br> <br>+OSG_INIT_SINGLETON_PROXY(ProxyInitRegistry, Registry::instance())<br> <br>+<br> // definition of the Registry<br> Registry::Registry()<br> {<br>Index: src/osgViewer/ViewerBase.cpp<br>===================================================================<br>--- src/osgViewer/ViewerBase.cpp (revision 15142)<br>+++ src/osgViewer/ViewerBase.cpp (working copy)<br>@@ -40,23 +40,6 @@<br> <br> using namespace osgViewer;<br> <br>-<br>-struct InitRegistry<br>-{<br>- InitRegistry()<br>- {<br>- osgDB::Registry::instance();<br>- }<br>-<br>- ~InitRegistry()<br>- {<br>- osgDB::DatabasePager::prototype() = 0;<br>- osgDB::Registry::instance(true);<br>- }<br>-};<br>-<br>-static InitRegistry s_InitRegistry;<br>-<br> ViewerBase::ViewerBase():<br> osg::Object(true)<br> {<br><br></div><div class="gmail_extra">This patch is also attached, under unix you can apply this with:<br><br></div><div class="gmail_extra"> cd OpenSceneGraph<br></div><div class="gmail_extra"> patch -p0 < singletons.patch<br><br></div><div class="gmail_extra">Could you test this out and let me know if it works fine or not.<br><br></div><div class="gmail_extra">Cheers,<br></div><div class="gmail_extra">Robert.<br></div><div class="gmail_extra"><br><br></div></div>
<br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">David Sinuela Pastor<br><br><div><br></div><div><font size="1"><b>Pix4D SA</b></font></div><div><font size="1"><b>EPFL Innovation Park</b></font></div><div><font size="1"><b>Building D</b></font></div>
<div><font size="1"><b>1015 Lausanne - Switzerland</b></font></div><div><font size="1"><b>Email: <a href="mailto:david.sinuela@pix4d.com" target="_blank"></a><a href="mailto:david.sinuela@gmail.com" target="_blank">david.sinuela@pix4d.com</a></b></font></div>
<div><b style="font-size:x-small">Skype: david.sinuela.pix4d</b><br></div><div><font size="1"><a href="http://www.pix4d.com" target="_blank"><b>www.pix4d.com</b></a></font></div></div></div></div></div>
</div>