Re: Lifetime management of InProc server inside an OutProc server
Stuart Redmann wrote:
What is still an interesting question to me is whether ATL's module
life-time management is flawed
No. You have two independent modules here, each correctly managing its =
own lifetime and that of its objects. The problem is, your EXE server is =
handing out somebody else's pointers as if they were its own, but takes =
no steps to ensure that it outlives those objects. On the other hand, =
all a DLL server can do is return false from DllCanUnloadNow and hope =
that someone cares - it cannot prevent the hosting process from =
terminating.
or whether I am doing things that are
not meant to be done (creating InProc components inside OutProc
servers is not prohibited by COM in any way
It's not. But handing out interface pointers from that InProc server to =
out-of-process clients has to be done with extra care.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not =
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly overhead. =
-- RFC 1925