Consultor Eletrônico



Kbase P63018: What is the scope of an output parameter defined as MEMPTR?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   14/12/2009
Status: Verified

GOAL:

What is the scope of an output parameter defined as MEMPTR?

GOAL:

When is memory released for memptr output parameters?

GOAL:

Do I need to release MEMPTR OUTPUT parameters on remote AppServers?

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.x

FIX:

On the remote cases, the output memptrs are deleted once they are on the wire back to the calling .p. The remote calling .p must do a SET-SIZE to zero before the call if it does not want a memory leak. Then when it receives the output memptr, it must do a SET-SIZE to 0 on it as well when it is done with it.

The local case is different. The memptr is shared between the two procedures, so the caller is the only one (as in the remote) who has to do a SET-SIZE 0. The callee should not do a SET-SIZE 0 on the output parameter.

This is no different for internal procedures and persistent procedures. If the callee wants to have an ongoing copy of the memptr, he should make a separate copy for himself. Otherwise his copy will get deleted.