free                   package:XML                   R Documentation

_R_e_l_e_a_s_e _t_h_e _s_p_e_c_i_f_i_e_d _o_b_j_e_c_t _a_n_d _c_l_e_a_n _u_p _i_t_s _m_e_m_o_r_y _u_s_a_g_e

_D_e_s_c_r_i_p_t_i_o_n:

     This generic function is available for explicitly releasing the
     memory associated with the given object. It is intended for use on
     external pointer objects which do not have an automatic  finalizer
     function/routine that cleans up the memory that is used by the
     native object. This is the case, for example, for an
     XMLInternalDocument. We cannot free it with a finalizer in all
     cases as we may have a reference to a node in the associated
     document tree. So the user must explicitly release the
     XMLInternalDocument object to free the memory it occupies.

_U_s_a_g_e:

     free(obj)

_A_r_g_u_m_e_n_t_s:

     obj: the object whose memory is to be released, typically an
          external pointer object or object that contains a slot that
          is an external pointer.  

_D_e_t_a_i_l_s:

     The methods will generally call a C routine to free the native
     memory.

_V_a_l_u_e:

     An updated version of the object with the external address set to
     NIL. This is up to the individual methods.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

_S_e_e _A_l_s_o:

     'xmlTreeParse' with 'useInternalNodes = TRUE'

_E_x_a_m_p_l_e_s:

      f = system.file("exampleData", "boxplot.svg", package = "XML")
      doc = xmlTreeParse(f, useInternalNodes = TRUE)
      nodes = getNodeSet(doc, "//path")
      rm(nodes)
      free(doc)

