Hum.. I always figured (and still believe) this sort of behavior is a compiler bug. One should be able to pass in implicitly constructed objects by reference into these statically initialized arrays of structs... C++ should dictate that the lifetime of these objects then are controlled by the construction and destruction of the structs in the arrays... when the structs are destructed, then the object with reference should be destructed...
Or am I incorrect? I'll give a try to reproduce what you're seeing Paul, and we will have a fix for it. Is this fixed if the VS6 fix is applied to VS2008? is that what you did to fix this issue? If so, then I think we should probably go with that approach (using const char* instead of const UtlString&) unconditionally. On Fri, Dec 12, 2008 at 12:34 AM, Paul Whitfield <pa...@omnitronics.com.au>wrote: > >> How do I run the Topology graph instead of the CallFlowGraph? > > > > Basically you should define following preprocessor defines for > > sipXmediaAdapterLib: > > DISABLE_DEFAULT_PHONE_MEDIA_INTERFACE_FACTORY > > ENABLE_TOPOLOGY_FLOWGRAPH_INTERFACE_FACTORY > > > > If you use Linux, then it can be done by passing --enable-topology-graph > > option to configure. Under Windows you have to change project's > > configuration. Btw, in VS6, VS2003 and VS2005 Debug builds > > Topology is enabled by default now. We should do the same > > for Release configurations too to avoid confusion. > > > > > When compiling with VS2008, with the definitions above, the > library crashes on initialisation. > > After much investigation today, it appears to be an issue > with how VS2008 initialises static classes. > > Specifically in > > spiXmediaAdaptorLib/CpTopologyGraphFactoryImpl.cpp, > > initalTopologyResources[] is set to a correct default values, > however, VS2008 appears to create temporary objects (on the stack) > and point to them. > > By the time initialTopologyResourcse is used they are out of > scope and they contain rubbish!. The same is true for the > other similarly initialised static classes/struct in this > file/mode. > > In the file MpResourceTopology.h there is a > #if defined(_MSC_VER) && ( _MSC_VER <= 1200 ) > that prevents this on Visual Studio 6.0. > > However, it appears that it is also broken for VS2008.. > > As a test, I modified this file so that > there where no statically initialised UtlString > objects. > > This fixed the initialisation issues, well at least the code started up > without crashing. > > For now I have gone back to using the MpCallFlowGraph rather > than MpTopology. > > So for the time being it appears that the Topology code is broken on > VS2008. :-( > > NOTE: I am not expecting anyone to fix this, I just want to make > sure that everyone knows about it to save anyone else having to > figure it out! > > Regards > > > Paul > _______________________________________________ > sipxtapi-dev mailing list > sipxtapi-dev@list.sipfoundry.org > List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/ > -- Keith Kyzivat SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000
_______________________________________________ sipxtapi-dev mailing list sipxtapi-dev@list.sipfoundry.org List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/