#include#include #include int main(int argc, char** argv) { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); PortableServer::POA_var poa = PortableServer::POA::_narrow(orb->resolve_initial_references("RootPOA")); PortableServer::ObjectId_var oid = poa->activate_object(new MyObject()); PortableServer::Object_var obj = poa->id_to_reference(oid.in()); CORBA::String_var sior(orb->object_to_string(obj.in())); poa->destroy(true, true); //Destroys the POA and releases resources return 0; }
#includeThis example creates a POA and immediately calls the destroy function to destroy and release it. The CPP PortableServer POA_var destroy function is part of the PortableServer CORBA package library.#include #include int main(int argc, char** argv) { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); PortableServer::POA_var poa = PortableServer::POA::_narrow(orb->resolve_initial_references("RootPOA")); poa->destroy(true, true); //Destroys the POA and releases resources return 0; }