void
test_free (void  *memory)
{
  if (memory) /* we guarantee it's safe to free (NULL) */
    {
      n_blocks_outstanding -= 1;

      xmlMemFree (memory);
    }
}
Example #2
0
NamespaceList Node::NamespacesInScope() const
{
    NamespaceList result;
    xmlNsPtr *pNamespaces = xmlGetNsList(_xml->doc, _xml);
    if ( pNamespaces == nullptr )
        return result;
    
    for ( int i = 0; pNamespaces[i] != nullptr; i++ )
    {
        xmlNsPtr xmlNs = pNamespaces[i];
        result.push_back(Wrapped<class Namespace, _xmlNs>(xmlNs));
    }
    
    xmlMemFree(pNamespaces);
    
    return result;
}
Example #3
0
OutputBuffer::~OutputBuffer()
{
    xmlMemFree(_buf);
    _buf = nullptr;
}