views:

138

answers:

2

I have 2 dlls: A and B.

From a code in dll A, I am loading dynamically the dll B (using dlopen on Unix and LoadLibrary on Windows). Is it guaranteed that B will be unloaded before A?

Is there any difference between Unix and Windows behavior?

+1  A: 

There is no guarantee as to which DLL will be unloaded first (Unix and WIndows do not differ on this point).

Motti
A: 

If you load the dll "B" inside dll "A" manually - which I suppose from your question -, I would assume you unload the dll "B" manually as well.

wroemer