Hello Clive,
could you be so kind and post as short as possible example here? If I
understand you well, there is no need to link object file with one
concrete marshaler type to two libraries, or is it? IMHO if you link it
only to one library your problem should disappear or am I wrong?
Cheers,
Karel
--
Karel Gardas [EMAIL PROTECTED]
ObjectSecurity Ltd. http://www.objectsecurity.com
---
Need experienced, fast, reliable technical MICO support?
---> http://www.objectsecurity.com/mico_commsup_referral.html <---
---
On Thu, 23 Feb 2006, Clive Butler wrote:
Hi all,
I've run across what I think may be an issue with the way that MICO manages
construction/destruction of the marshalling functions, specific
to the scenario involving the building of shared libraries that link
against MICO-generated code.
For each IDL-described data structure, MICO generates a global pointer
to its marshalling class, and a typecode information structure with file
scope. The (global) constructor of the type code class allocates the global
instance of the marshalling class and the (global) destructor destroys the
marshalling class instance.
I build two shared libraries, each of which uses such a common
structure, then link a main program against both libraries. The problem
is that the global constructors and destructors for the file scope
objects are run twice since the objects occur twice (once per library).
The destructors thus perform a double delete, resulting in undesired
behavior during exit().
As far as I can tell, there's no way to guarantee that the file scope
constructors/destructors will be called exactly once. The main effect of the
problem can be evaded by having the destructor code set the global pointer to
0 after the delete.
Any other ideas? This is on Linux (FC4 with gcc 4.0.2, binutils-2.15.94,
etc.) but I don't think the problem is specific to this platform.
Cheers,
Clive
_______________________________________________
Mico-devel mailing list
[email protected]
http://www.mico.org/mailman/listinfo/mico-devel
--
Karel Gardas [EMAIL PROTECTED]
ObjectSecurity Ltd. http://www.objectsecurity.com
_______________________________________________
Mico-devel mailing list
[email protected]
http://www.mico.org/mailman/listinfo/mico-devel