void RecursiveDestroy (TreeNode *p) {
	if(p == NULL)
		return;
	RecursiveDestroy(p->left);
	RecursiveDestroy(p->right);
	/*free the value of the node, then the node itself*/
	destroyValue(p->value);
	free(p);
}
Esempio n. 2
0
void 
xmlrpc_DECREF (xmlrpc_value * const valueP) {

    XMLRPC_ASSERT_VALUE_OK(valueP);
    XMLRPC_ASSERT(valueP->_refcount > 0);
    XMLRPC_ASSERT(valueP->_type != XMLRPC_TYPE_DEAD);

    valueP->_refcount--;

    /* If we have no more refs, we need to deallocate this value. */
    if (valueP->_refcount == 0)
        destroyValue(valueP);
}
Esempio n. 3
0
    void copyAssign(const OptionalImplBase<T>& other)
    {
        if (other.m_hasValue)
        {
            if (m_hasValue)
            {
                *ptr() = *other.ptr();
            }
            else
            {
                new (ptr()) T{*other.ptr()};
            }
        }
        else
        {
            destroyValue();
        }

        m_hasValue = other.m_hasValue;
    }
Esempio n. 4
0
    void moveAssign(OptionalImplBase<T>&& other)
    {
        if (other.m_hasValue)
        {
            if (m_hasValue)
            {
                *ptr() = std::move(*other.ptr());
            }
            else
            {
                new (ptr()) T{std::move(*other.ptr())};
            }

            other.destroyValue();
        }
        else
        {
            destroyValue();
        }

        m_hasValue = other.m_hasValue;
    }
Esempio n. 5
0
 T release()
 {
     auto tmp = std::move(value());
     destroyValue();
     return tmp;
 }
Esempio n. 6
0
 /**
  * @brief   Destructor.
  */
 ~OptionalImplBase()
 {
     destroyValue();
 }
Esempio n. 7
0
 void copyAssign(const T& obj)
 {
     destroyValue();
     new (ptr()) T{obj};
     m_hasValue = true;
 }
Esempio n. 8
0
 void moveAssign(T&& obj)
 {
     destroyValue();
     new (ptr()) T{std::forward<T>(obj)};
     m_hasValue = true;
 }
Esempio n. 9
0
ElementProperty::~ElementProperty() {
	destroyValue(type, defValue);
}
Esempio n. 10
0
DataValue::~DataValue() {
	destroyValue(type, value);
}