ImageGear .NET v25.2 - Updated
Developer Guide / How to Work with... / OCR / Concepts / Object Structure, Lifetime, and Disposal
In This Topic
    Object Structure, Lifetime, and Disposal
    In This Topic

    This topic provides information about the following:

    OCR API Object Structure

    The OCR API uses a simple object structure with two top-level objects:

    • All references to the ImGearOCRPage object and any associated child objects (i.e., not ImGearOCR) cease to exist and garbage collection occurs, or
    • The application calls the Dispose method.
      The Dispose method lets the application free resources associated with the ImGearOCRPage object. In order to minimize resource usage, it's recommended to explicitly call this Dispose method whenever an ImGearOCRPage object is no longer needed by the application. The application cannot use an ImGearOCRPage object or its associated child objects after having called its Dispose method.

    Visual representation of the hierarchy:

     Engine (ImGearOCR)

    Page (ImGearOCRPage)

    Common Reasons to Call the Dispose Method

    Under normal circumstances an application is not required to call a Dispose method. The most common reasons to call this method are: