[omniORB] exception (2) client code fragment

Lolke B. Dijkstra omniorb at dijkstra-ict.com
Sun Jan 8 11:43:06 GMT 2006


To make it more clear here is the client code fragment:

            try {
                dicom::patient::PN_var patient = ipatient->getName( oid );
                cerr << patient.in() << endl;
            }
            catch( dicom::ObjectNotFound& e ) {
                cerr << "error" << endl;
            }    


further down somewhere the SystemException gets caught.

There is however another thing that seems different from what I've learnt.
At the end of the try block (after printing the patient) the program 
crashes (using the code I show here) that's why I modified it to

                dicom::patient::PN* patient = ipatient->getName( oid );
                cerr << patient << endl;

which works fine. That seems strange. I receive a reference to a new 
object and take responsibility for deleting it by using the var. That's 
what it should be, right?

Some additional info:
I work with VS 7.1
Memory model /MD resp. /MDd for both client and server.

Does somebody have a clue? It would be greatly appreciated.





More information about the omniORB-list mailing list