Memory management question

Jules Colding <[email protected]>
Newsgroups gmane.comp.gnome.orbit.general
Message-ID <1106311423.29842.61.camel@omc-3>
Hi,

I have an interface such as:

module BRUTUS {
	union SRestriction {
		/* lots of variable sized stuff */
	};

	interface SRestrictionContainer {
		readonly attribute SRestriction content; 
	}
};


The get_content() attribute method is defined as:

static BRUTUS_SRestriction *impl_BRUTUS_SRestrictionContainer__get_content(impl_POA_BRUTUS_SRestrictionContainer *servant,
									   CORBA_Environment *ev)
{
        BRUTUS_SRestriction *retval;

        /* ------   insert method code here   ------ */
	retval = &servant->attr_content;
        /* ------ ---------- end ------------ ------ */

        return retval;
}

So my question is now: Should I just return a pointer to attr_content as
I do above or should I make a copy of servant->attr_content ?


Thanks,
  jules
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.