|
|
Classification: |
C++ |
Category: |
Base |
Created: |
10/19/2000 |
Modified: |
09/11/2002 |
Number: |
FAQ-0530 |
Platform: |
Not Applicable |
|
Question: If I've an instance or a pointer to an R or M class, but it's not a member of the current class, I'll want their resources
to be cleaned up if there's a Leave. R classes typically need a Close() call. M classes typically need a Release() call.
Answer: The template functions CleanupDeletePushL(), CleanupClosePushL() and CleanupReleasePushL() push cleanup items onto the cleanup stack which cause the appropriate item to be called. They are declared in S32STRM.H.
E.g. RFile& aFile; CleanupClosePushL(aFile);
To save code size some M classes define their own PushL and Pop functions which do this for you. E.g. RReadStream, RWriteStream,
MStreamBuf.
|
|
|