Boost logo

Boost Users :

From: Topi Mäenpää (topi.maenpaa_at_[hidden])
Date: 2005-11-03 09:07:11


Hi,

Some time ago, we had a discussion about serialization of dynamically
loaded classes. I got my code work on Linux, but still cannot do the
same on Windows. I'd like someone to elaborate the stuff below a bit:

Robert Ramey wrote:
> Another post has me convinced that the problem is that there are multiple
> copies of a base class extended_type_info record which I believe
> shouldn't occur.

I can confirm that this indeed happens.

> If you trap your debugger the serialization.dll (shared_lib) at line 58 of
> extened_type_info.cpp you should trap every time an extended_type_info
> record is "self_registered". Examination of the stack should reveal
> where this is being called from. I expect that the base class is being
> self registered from both the DLL as well as the main executable.

Whenever I register a class from a DLL, its base classes get registered
as well, although they already have been registered. If I load multiple
DLLs that all contain derived classes, the base classes are registered
many times, but only once for each DLL.

> My current thinking is that this behavior should be prohibited and
> detected with an exception. Other users have addressed this
> by tweaking the code in extended_type_info.cpp to permit
> multiple "self registration" of the same extended_type_info type.
> This eliminated their symptoms and everything seems to work.
> But from my understanding of the library, I believe this just
> hides a deeper problem.

Can someone point out the details? How should this be done? Any other
suggestions?

Best regards,
Topi


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net