Quote:
|
Originally Posted by litghost
I put the Ice::ObjectPrx in a struct, and destroy the struct before calling the communicator shutdown/destroy, I don't think so.
|
What do you mean "destroy the struct"?
Quote:
|
What would be an example of this, because I don't think I quite understand what you mean.
|
Code:
class FooI : public Foo
{
public:
//...
BarPtr bar;
};
typedef IceUtil::Shared<FooI> FooIPtr;
class BarI : public Bar
{
public:
//...
FooPtr foo;
};
typedef IceUtil::Shared<BarI> BarIPtr;
FooIPtr foo = new FooI();
BarIPtr bar = new BarI();
foo->bar = bar;
bar->foo = foo;
Quote:
<InterfaceName>Prx, like MonitorPrx. I have it as global, but it won't get initilized until the
Code:
monitorOut = XPlane::ReturnInterfacePrx::uncheckedCast(pub);
line. How do I check for that, and if it has been initilized how to shut it down.
|
Perhaps this global is the cause of your leak?
If you want to see whether the proxy has been assigned yet then you can simply do:
Code:
if(monitorOut)
{
// Initialized
}
What do you mean by shut it down?
Quote:
|
Even if the Ice::ObjectAdapterPtr goes out of scope? Ok.
|
Everything is reference counted in Ice, so yes. Nothing goes away if you are using it
Quote:
What would the code look like? This line is the one the confuses me
Code:
proxy = adapter->addWithUUID(monitorIn);
Does this not bind monitorIn to the proxy? Can I have different MonitorPrt's(monitorIn's type) too different topics, on the same proxy?
|
I don't know what you mean by "bind". There is no explicit association of the proxy with the servant if that's what you mean. The lifecycle of the proxy has nothing to do with the lifecycle of the Ice object at all.
A proxy refers to an Ice object which is identified by the objects identity. In the case of the Ice object that you've given above the identity is a UUID. UUIDs are generated randomly and is guaranteed to be unique.
Given that a proxy refers to exactly one Ice object, the answer to your second question is no. Each proxy refers to one instance of an Ice object, not multiple.