[Qt-interest] A shared singleton and Q_EXPORT_PLUGIN2

Ben Martin monkeyiq at users.sourceforge.net
Sat Jan 2 03:09:21 CET 2010


Hi,
   While tinkering with Soprano I found an issue where it is using a
Q_GLOBAL_STATIC from both its main library and inside a plugin that it
loads to handle serialization. It seems that when declaring a method
containing a static variable (to try to create a singleton) the address
of the static variable will be different inside a Q_EXPORT_PLUGIN2 than
outside it.

  Has anyone got any pointers on creating shared singletons that are
robust across a Q_EXPORT_PLUGIN2 boundary?

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100102/723a17d9/attachment.bin 


More information about the Qt-interest-old mailing list