Releasing 3GP Parser Resources

This tutorial describes how to release 3GP Parser resources.

Purpose

When you have finished using the 3GP Parser, you must release all associated resources. The purpose of this tutorial is to show you how to complete the parsing process.

Required background

The 3GP Library Overview introduces the 3GP Parser.

Introduction

Use the C3GPParse::Complete() function to release 3GP Parser resources. If you want to reuse the 3GP Parser, you can open another file or buffer by calling one of the C3GPParse::Open() functions. If you no longer require the 3GP Parser, you can destroy the C3GPParse instance after calling C3GPParse::Complete().

Using Complete()

The following task is covered in this tutorial:

Releasing 3GP Parser resources

To release 3GP Parser resources:

Example

The following example shows you how to release 3GP Parser resources:

CMyApp::ReadFileL(const RFile& aFile)
    {
    ...
    // See example code in 3GP Parser tutorials.
    ...
    User::LeaveIfError(parser->Complete());
    CleanupStack::PopAndDestroy(parser);
    ...
    }

The following example shows you how to reuse the 3GP Parser after releasing resources:

CMyApp::ReadFileL(const RFile& aFile)
    {
    ...
    // See example code in 3GP Parser tutorials.
    ...
    // release all parser resource
User::LeaveIfError(parser->Complete());

// open a new file using the same parser
User::LeaveIfError(parser->Open(...));
...
    }