< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate-users] MessageDecorator::clone function of 1.4


The 1.4 has added a member function which named clone for class MessageDecorator, this is  a
pure virtual function and requires implement it in derivation class.
 
I have been wrote this function as below:
 
MessageDecorator* SipMessageDecorator::clone() const
{
 SipMessageDecorator * decorator = new SipMessageDecorator;
 decorator->setStunResult(mStunIP, mStunPort);
 return (MessageDecorator *)decorator;
}
 
 
So far with my testing it's working fine, but does there has memeory leak with "SipMessageDecorator * decorator = new SipMessageDecorator;" ?
Please advice, thanks.