Exemple #1
0
TBool CDbTableDatabase::CIncremental::NextL(TInt& aStep)
//
// if step is 1 then invopke the last step otherwise do
//
	{
	__ASSERT(!IsCommitted());
	if (iState==EFailed)
		__LEAVE(KErrDied);
	iState=EFailed;
	if (aStep!=ELastStep)
		{
		aStep=DoNextL(aStep);
		iState=ERunning;
		}
	else
		{
		DoLastL();
		aStep=0;
		iState=ECommitted;
		}
	return 0;	// return 0 for DDL incremental operations
	}
Exemple #2
0
CDbTableDatabase::CIncrementalDDL::~CIncrementalDDL()
	{
	if (!IsCommitted())
		Transaction().DDLRollback();
	}
Exemple #3
0
CDbTableDatabase::CUtility::~CUtility()
	{
	if (!IsCommitted())
		Transaction().UtilityRollback();
	}
VOID
FxObject::ProcessDestroy(
    VOID
    )
{
    FxTagTracker* pTagTracker;

    //
    // Set the debug info to NULL so that we don't use it after the
    // SelfDestruct call.  Setting the DestroyFunction to NULL
    // will also prevent reuse of the REF_OBJ after it has been destroyed.
    //
    pTagTracker = GetTagTracker();

    //
    // We will free debug info later.  It useful to hang on to the debug
    // info after the destructor has been called for debugging purposes.
    //
    if (pTagTracker != NULL) {
        pTagTracker->CheckForAbandondedTags();
    }

    //
    // Call the destroy callback *before* any desctructor is called.  This
    // way the callback has access to a full fledged object that hasn't been
    // cleaned up yet.
    //
    // We only do this for committed objects.  A non committed object will
    // *NOT* have additional contexts to free.
    //
    if (m_ObjectSize > 0 && IsCommitted()) {
        FxContextHeader* pHeader, *pNext;
        WDFOBJECT h;
        BOOLEAN first;

        //
        // We are getting the object handle when the ref count is zero.  We
        // don't want to ASSERT in this case.
        //
        h = GetObjectHandleUnchecked();













        for (pHeader = GetContextHeader(); 
             pHeader != NULL; 
             pHeader = pHeader->NextHeader) {

            //
            // Cleanup *may* have been called earlier in the objects
            // destruction, and in this case the EvtCleanupCallback will
            // be set to NULL. Ensuring its always called provides
            // symmetry to the framework.
            //

            //
            // No need to interlockexchange out the value of
            // EvtCleanupCallback because any codepath that might be calling
            // CallCleanup must have a valid reference and no longer have
            // any outstanding references
            //
            if (pHeader->EvtCleanupCallback != NULL) {
                pHeader->EvtCleanupCallback(h);
                pHeader->EvtCleanupCallback = NULL;
            }

            if (pHeader->EvtDestroyCallback != NULL) {
                pHeader->EvtDestroyCallback(h);
                pHeader->EvtDestroyCallback = NULL;
            }
        }

        first = TRUE;
        for (pHeader = GetContextHeader(); pHeader != NULL; pHeader = pNext) {
            
            pNext = pHeader->NextHeader;

            //
            // The first header is embedded, so it will be freed with the
            // object
            //
            if (first == FALSE) {
                FxPoolFree(pHeader);
            }

            first = FALSE;
        }
    }










    //
    // NOTE:  The delete of the tag tracker *MUST* occur before the SelfDestruct()
    // of this object.  The tag tracker has a back pointer to this object which
    // it dereferences in its own destructor.  If SelfDestruct() is called
    // first, then ~FxTagTracker will touch freed pool and bugcheck.
    //
    if (pTagTracker != NULL) {
        GetDebugExtension()->TagTracker = NULL;
        delete pTagTracker;
    }

    //
    // See NOTE above.
    //
    SelfDestruct();
}