Logo Search packages:      
Sourcecode: libpodofo version File versions  Download package

void PoDoFo::PdfMemDocument::FreeObjectMemory ( PdfObject pObj,
bool  bForce = false 
)

Tries to free all memory allocated by the given PdfObject (variables and streams) and reads it from disk again if it is requested another time.

This will only work if load on demand is used. Other- wise any call to this method will be ignored. Load on demand is currently always enabled when using PdfMemDocument. If the object is dirty if will not be free'd.

Parameters:
pObjfree object from memory
bForceif true the object will be free'd even if IsDirty() returns true. So you will loose any changes made to this object.
See also:
IsDirty

Definition at line 375 of file PdfMemDocument.cpp.

References PoDoFo::ePdfError_InvalidHandle, PoDoFo::PdfParserObject::FreeObjectMemory(), PODOFO_RAISE_ERROR, and PODOFO_RAISE_ERROR_INFO.

{
    if( !pObj ) 
    {
        PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
    }
    
    PdfParserObject* pParserObject = dynamic_cast<PdfParserObject*>(pObj);
    if( !pParserObject ) 
    {
        PODOFO_RAISE_ERROR_INFO( ePdfError_InvalidHandle, 
                                 "FreeObjectMemory works only on classes of type PdfParserObject." );
    }

    pParserObject->FreeObjectMemory( bForce );
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index