All interfaces from the ELFIO library should be freed after use. Each interface has a Release() function. It is not enough to only free the high level interface because one of the sections or readers will still be held and its resources will not be cleared.

The interfaces are freed immediately after their use, in this example we will free only the pReader object: