project BLF > class ComponentPool > method RemoveComponent

Description

remove a business component from memory


Parameters


irCPoolRowidinputrowid


Internal usage


BLF
method ComponentPool.EndComponentInPool
method ComponentPool.RemoveAllComponentsInPool
method ComponentPool.SaveStateInPool
method ComponentPool.StartComponentInPool


program code (program1/componentpool.p)

find brCPool where rowid(brCPool) = irCPoolRowid.

assign vhFcComponent = vhCustomizationController.
<M-1 run StopCustomization  (input  brCPool.thProc (ihProgram)) in CustomizationController>

vcSupers = brCPool.thProc:super-procedures.
run gipr_DeleteProcedure in brCPool.thProc.
delete procedure brCPool.thProc.
do viA = 1 to num-entries(vcSupers):
    assign vh_InsWork = widget-handle(entry(viA,vcSupers)).
    delete procedure vh_InsWork.
end.

if brCPool.tlRemoveOnClose
then delete brCPool.
else assign brCPool.tlIsInMemory = no
            brCPool.tlIsInUse = no
            brCPool.thIns = ?
            brCPool.tiInsID = 0.

assign viComponentCount = viComponentCount - 1.

/* clean up buffers used by this component */
if vhPersistenceInPool <> ?
then do:
    vhFcComponent = vhPersistenceInPool.
    <M-2 run ClearBuffers  () in persistence>
end.