Hi Vincent,
are you adding the export thingymajiggies to the singleton in your lib
for Windows? Getting singletons to work across DLL's in Windows is a pain.
We've had the same issues on Windows where a singleton was not exactly a
singleton. We were using the Loki::SingletonHolder and got it to work
eventually. The details are more than I'd like to remember, but the
mailing list of the Loki libs had some good information.
http://sourceforge.net/mailarchive/forum.php?forum_name=loki-lib-general
See also here:
http://developer.vrjuggler.org/ticket/12
jp
Vincent Bourdier wrote:
Hi Robert,
I get more info : the singleton is not destroyed, but is called from the
lib I did and from the exe itself. When the lib call the singleton, it
works good. when the exe call the singleton, It does a new call to
constructor ...
Any idea about how to solve that problem ?
Thanks.
Regards,
Vincent.
2009/5/19 Robert Osfield <robert.osfi...@gmail.com
<mailto:robert.osfi...@gmail.com>>
On Tue, May 19, 2009 at 2:24 PM, Vincent Bourdier
<vincent.bourd...@gmail.com <mailto:vincent.bourd...@gmail.com>> wrote:
> Hi Robert,
>
> I think I get it :
>
> I seems to be due to the osgDB::DynamicLibrary instance I use,
which ref_ptr
> unref when leaving the load code, so the destructor of the
> RegisterReaderWriterProxy (my equivalent) was called, and it
seems to be
> sufficient to force a new call to the Registry constructor.
>
> Does it sounds right for you ?
I can't comment on code I'm not party to.
As a general note one shouldn't be able to delete a internally
singleton used in my example without doing a instance()=0; Just take
a ref_ptr<> to the return won't delete the object as the instance()
method keeps around a copy.
Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
<mailto: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
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org