[Pythonmac-SIG] omniORBpy weirdness on Panther

Zachery Corbiere zcorb at fluidarch.com
Sat Dec 6 23:56:07 EST 2003


I have a strange issue with omniORBpy on Panther.  omniORBpy is a CORBA 
ORB written in C++.  The python binding is, itself, a c++ file with the 
Python-important symbols declared "extern C {}".

The problem is that "singleton" objects within the omniORB code are 
being created twice when I import the omniORB module into Python.  
However, I've verified that static constructors are only executed once 
(or at lest that's what it seems like).  For example, in the following 
code:

orbOptions&
orbOptions::singleton() {
   static orbOptions* singleton_ = 0;
   if (!singleton_) {
     singleton_ = new orbOptions();
   }
   return *singleton_;
}

singleton_ is being initialized two times.  I've verified this both by 
placing debug printfs inside the if{} block as well as within the 
orbOptions constructor (which is private).

This particular singleton is first accessed by some static 
constructors, and I haven't figured out how to trace into that with gdb 
yet (hints?).

The same code works fine on Linux and Win32.  I'm a total newbie in OSX 
development.  I'm sort of hoping someone says something like, "Oh, 
yeah, that's such and so problem.  Happens all the time, and you fix it 
like this..." ;-)

Thanks for any help!

-- 
Zac Corbiere
zcorb at fluidarch.com




More information about the Pythonmac-SIG mailing list