BIND 10 #250: are Element::create() variants exception free?

BIND 10 Development do-not-reply at isc.org
Wed Jun 23 05:53:53 UTC 2010


#250: are Element::create() variants exception free?
-----------------------------+----------------------------------------------
 Reporter:  jinmei           |       Owner:  jelte                                         
     Type:  defect           |      Status:  new                                           
 Priority:  major            |   Milestone:  05. 3rd Incremental Release: Serious Secondary
Component:  message-library  |    Keywords:                                                
Sensitive:  0                |  
-----------------------------+----------------------------------------------
 The documentation states:

 {{{
     /// \name Direct factory functions
     /// \brief These functions simply wrap the given data directly
     /// in an Element object, and return a reference to it, in the form
     /// of an \c ElementPtr.
     /// If there is a memory allocation problem, these functions will
     /// return a NULL ElementPtr, which can be checked with
     /// Element::is_null(ElementPtr ep).
     //@{
     static ElementPtr create(const int i);
     ...
 }}}

 But the actual code doesn't seem to handle allocation failure:

 {{{
 ElementPtr
 Element::create(const int i) {
     return ElementPtr(new IntElement(i));
 }
 ...
 }}}

 Am I missing something?  Or does either the doc or the implementation need
 to be fixed?

 I'm giving this to Jelte because I believe he should know this stuff best.

-- 
Ticket URL: <https://bind10.isc.org/ticket/250>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list