Hello<br><br>When I stop my application, running under windows 2000, the Microsoft Visual C++ logs the following info debug (I have paste just some lines of it). <br><br>My code never pass trough "orb->destroy()". Could it be the cause of the memory leaks?
<br><br>Can I do something not to have these?<br><br>I have read other questions in this list about memory leaks, but I can't see how to solve my problem.<br><br>Thanks<br><br><br>Creation of the CORBA thread:<br><br>
DWORD WINAPI HiloCorba(void *Param)<br>{<br> CORBA::ORB_var orb;<br> <br> try { <br> //------------------------------------------------------------------------
<br> // Initialize CORBA ORB - "orb"<br> //------------------------------------------------------------------------<br> int argc=0; // Dummy variables to support following call.<br> char** argv=0;
<br><br> orb = CORBA::ORB_init(argc, argv);<br> <br> //------------------------------------------------------------------------<br> // Servant must register with POA in order to be made available for client
<br> // Get reference to the RootPOA.<br> //------------------------------------------------------------------------<br> CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");<br> PortableServer::POA_var _poa = PortableServer::POA::_narrow(
obj.in());<br> <br> //------------------------------------------------------------------------<br> // Operations defined in object interface invoked via an object reference.
<br> // Instance of CRequestSocketStream_i servant is initialized.<br> //------------------------------------------------------------------------ <br> CDT_CS_Request_i* myInfoRequest= new CDT_CS_Request_i();<br>
<br> //------------------------------------------------------------------------<br> // Servant object activated in RootPOA.<br> // (Object id used for various POA operations.)
<br> //------------------------------------------------------------------------<br> PortableServer::ObjectId_var myInfoRequest_oid = _poa->activate_object(myInfoRequest);<br>
<br> //------------------------------------------------------------------------<br> // Obtain object reference from servant and register in naming service(??)<br> //------------------------------------------------------------------------
<br> CORBA::Object_var SA_obj = myInfoRequest->_this();<br> <br> //------------------------------------------------------------------------
<br> // Obtain a reference to the object, and print it out as string IOR.<br> //------------------------------------------------------------------------<br> CORBA::String_var sior(orb->object_to_string(SA_obj.in()));
<br> cerr << "'" << (char*)sior << "'" << endl;<br>
<br> //------------------------------------------------------------------------<br> // Bind object to name service as defined by directive InitRef<br> // and identifier "NameService" in config file omniORB.cfg
.<br> //------------------------------------------------------------------------<br> CORBA::Object_var obj1=orb->resolve_initial_references("NameService");<br> assert(!CORBA::is_nil(obj1.in()));<br>
<br> //------------------------------------------------------------------------<br> // narrow this to the naming context<br> //------------------------------------------------------------------------<br> CosNaming::NamingContext_var nc = CosNaming::NamingContext::_narrow(
obj1.in());<br> assert(!CORBA::is_nil(nc.in()));<br> <br> //------------------------------------------------------------------------<br>
// Bind to CORBA name service. Same name to be requested by client.<br> //------------------------------------------------------------------------<br> CosNaming::Name name;<br> name.length(1);<br> name[0].id=CORBA::string_dup("DispatcherServiceServ");
<br> nc->rebind (name,SA_obj.in());<br> <br> myInfoRequest->_remove_ref();
<br> <br> //------------------------------------------------------------------------<br> // Activate the POA manager<br> //------------------------------------------------------------------------
<br> PortableServer::POAManager_var pmgr = _poa->the_POAManager();<br> pmgr->activate();<br> <br> //------------------------------------------------------------------------
<br> // Accept requests from clients<br> //------------------------------------------------------------------------<br> orb->run();<br><br> //------------------------------------------------------------------------
<br> // If orb leaves event handling loop.<br> // - <span style="background-color: rgb(255, 255, 51);">currently configured never to time out</span> (??)<br> //------------------------------------------------------------------------
<br> orb->destroy();<br> <br> free(name[0].id); // str_dup does a malloc internally*/<br> }
<br> catch(CORBA::SystemException&) {<br> cerr << "Caught CORBA::SystemException." << endl;<br> }<br> catch(CORBA::Exception&)<br> {<br> cerr << "Caught CORBA::Exception." << endl;
<br> }<br> catch(omniORB::fatalException& fe) {<br> cerr << "Caught omniORB::fatalException:" << endl;<br> cerr << " file: " << fe.file() << endl;
<br> cerr << " line: " << fe. line() << endl;<br> cerr << " mesg: " << fe.errmsg() << endl;<br> }<br> catch(...) {<br> cerr << "Caught unknown exception." << endl;
<br> }<br>return 0;<br>}<br><br><br><br><br>MEMORY LEAKS<br><br>Detected memory leaks!<br>Dumping objects -><br>{2907} normal block at 0x0092C500, 100 bytes long.<br> Data: < p g > 1C 70 C1 67 10 C5 14 00 FF FF FF FF 00 00 00 00
<br>{2889} normal block at 0x0092C300, 228 bytes long.<br> Data: <8 g JBOC g> 38 E6 D0 67 00 00 00 00 4A 42 4F 43 0C E6 D0 67 <br>{2815} normal block at 0x0092B728, 4 bytes long.<br> Data: <h > 68 C2 92 00
<br>plex.cpp(31) : {2807} normal block at 0x0092BFE8, 124 bytes long.<br> Data: < > 00 00 00 00 00 00 00 00 04 00 CC 00 08 BF 92 00 <br>map_pp.cpp(72) : {2806} normal block at 0x0092BF60, 68 bytes long.
<br> Data: < > EC BF 92 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>{2805} client block at 0x0092BF08, subtype 0, 20 bytes long.<br>a CInternetSession object at $0092BF08, 20 bytes long<br>{2803} normal block at 0x0092BDF8, 100 bytes long.
<br> Data: < XF XF cF > B4 58 46 00 D0 58 46 00 CD CD CD CD D8 63 46 00 <br>{2790} normal block at 0x0092B7D8, 16 bytes long.<br> Data: < 3 @4 > 00 33 92 00 40 34 92 00 84 B7 92 00 00 C3 92 00
<br>{2789} normal block at 0x0092B770, 32 bytes long.<br> Data: < g g > 04 E8 D0 67 14 E8 D0 67 00 00 00 00 00 00 00 00 <br>{2785} normal block at 0x00927380, 12 bytes long.<br> Data: <TSQS e g> 54 53 51 53 01 00 00 00 18 65 D9 67
<br>{2783} normal block at 0x0092B868, 14 bytes long.<br> Data: <<a href="http://192.168.2.114">192.168.2.114</a> > 31 39 32 2E 31 36 38 2E 32 2E 31 31 34 00 <br>{2760} normal block at 0x00927338, 4 bytes long.<br> Data: < p > 98 70 92 00
<br>{2616} normal block at 0x00926FF8, 12 bytes long.<br> Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 <br>{2610} normal block at 0x00926E08, 24 bytes long.<br> Data: < > 00 B4 14 00 FF FF FF FF 00 00 00 00 00 00 00 00
<br>{2603} normal block at 0x00926DA0, 32 bytes long.<br> Data: < > 01 00 00 00 01 00 01 00 01 00 00 00 01 00 01 05 <br>{2597} normal block at 0x00926BC0, 24 bytes long.<br> Data: < > C8 B3 14 00 FF FF FF FF 00 00 00 00 00 00 00 00
<br>{2587} normal block at 0x00926588, 24 bytes long.<br> Data: < > 20 B3 14 00 FF FF FF FF 00 00 00 00 00 00 00 00 <br>{2586} normal block at 0x00926530, 24 bytes long.<br> Data: < > E8 B2 14 00 FF FF FF FF 00 00 00 00 00 00 00 00
<br>{2585} normal block at 0x00925098, 24 bytes long.<br> Data: < > B0 B2 14 00 FF FF FF FF 00 00 00 00 00 00 00 00 <br>{2583} normal block at 0x009264E8, 4 bytes long.<br> Data: < d > 90 64 92 00
<br>{2573} normal block at 0x009220E0, 4 bytes long.<br> Data: < > 88 20 92 00 <br>{2562} normal block at 0x00925280, 8 bytes long.<br> Data: <H (R > 48 1E 92 00 28 52 92 00 <br>{2561} normal block at 0x00925228, 17 bytes long.
<br> Data: <<a href="http://127.0.0.1">127.0.0.1</a> > 31 32 37 2E 30 2E 30 2E 31 00 CD CD CD CD CD CD <br>{2559} normal block at 0x00921E48, 17 bytes long.<br> Data: <<a href="http://192.168.2.114">192.168.2.114
</a> > 31 39 32 2E 31 36 38 2E 32 2E 31 31 34 00 CD CD <br>{2552} normal block at 0x00923440, 12 bytes long.<br> Data: <h g JBOC> 68 D0 D0 67 00 00 00 00 4A 42 4F 43 <br>{2475} normal block at 0x00925168, 37 bytes long.
<br> Data: <<span style="background-color: rgb(255, 255, 51);">NameService=corb</span>> 4E 61 6D 65 53 65 72 76 69 63 65 3D 63 6F 72 62 <br>{2474} normal block at 0x00925120, 12 bytes long.<br> Data: < g ghQ > E8 67 D9 67 68 51 92 00 02 00 00 00
<br>{2471} normal block at 0x00924FF8, 2 bytes long.<br> Data: <1 > 31 00 <br><br>(...)<br><br>