Ejemplo n.º 1
0
//--------------------------------------------------------------------------------------------------
void ni_Release
(
    ni_IteratorRef_t iteratorRef  ///< [IN] Free the resources used by this iterator.
)
//--------------------------------------------------------------------------------------------------
{
    LE_ASSERT(iteratorRef != NULL);

    // Make sure that the transaction timer isn't still running.
    if (iteratorRef->timerRef != NULL)
    {
        if (le_timer_GetExpiryCount(iteratorRef->timerRef) == 0)
        {
            le_timer_Stop(iteratorRef->timerRef);
        }

        le_timer_Delete(iteratorRef->timerRef);
        iteratorRef->timerRef = NULL;
    }

    // Release the rest of the iterator's resources.
    LE_DEBUG("Releasing iterator, <%p> with a lifetime of %d seconds.",
             iteratorRef,
             (uint32_t)(le_clk_GetRelativeTime().sec - iteratorRef->creationTime.sec));

    ni_Close(iteratorRef);
    tdb_UnregisterIterator(iteratorRef->treeRef, iteratorRef);

    le_pathIter_Delete(iteratorRef->pathIterRef);

    tdb_ReleaseTree(iteratorRef->treeRef);
    le_mem_Release(iteratorRef);
}
Ejemplo n.º 2
0
//--------------------------------------------------------------------------------------------------
void ni_Release
(
    ni_IteratorRef_t iteratorRef  ///< Free the resources used by this iterator.
)
//--------------------------------------------------------------------------------------------------
{
    LE_ASSERT(iteratorRef != NULL);

    LE_DEBUG("Releasing iterator, <%p>.", iteratorRef);

    ni_Close(iteratorRef);
    tdb_UnregisterIterator(iteratorRef->treeRef, iteratorRef);

    le_pathIter_Delete(iteratorRef->pathIterRef);

    tdb_ReleaseTree(iteratorRef->treeRef);
    le_mem_Release(iteratorRef);
}