Community

[FlexiCapture Engine 11] Logging of unreleased objects in FCEngine 11

The FlexiCapture Engine 11 User Guide says:

You can get the list of not released objects, if you call the IEngine::StartLogging method before deinitialization.

My code (note that Engine and libraryHandle have been initialized, and StartLogging was called):

  CSafePtr<iengine> Engine;
  static HMODULE libraryHandle;
  ...
  Log::log("UnloadFCEngine: begin\n");
  // Create an object that won't be released, hoping to see it mentioned in the log
  IImageLoadingParams* imageLoadingParams;
  CheckResult( Engine->CreateImageLoadingParams(&imageLoadingParams) );
  // Deinitialize FlexiCapture Engine
  typedef HRESULT ( STDAPICALLTYPE* DeinitializeEngineFunc )();
  DeinitializeEngineFunc pDeinitializeEngine =
    ( DeinitializeEngineFunc )GetProcAddress( libraryHandle, "DeinitializeEngine" );
  if( pDeinitializeEngine == 0 || pDeinitializeEngine() != S_OK ) {
    throw CAbbyyException( L"Error while unloading ABBYY FlexiCapture Engine" );
  }
  FreeLibrary( libraryHandle );
  libraryHandle = 0;
  Engine = 0;
  Log::log("UnloadFCEngine: end\n");

The resulting log messages:

06-22-2016 12:09:19 UnloadFCEngine: begin
12:09:19.842, 0 ms,     IEngine::CreateImageLoadingParams( ( IImageLoadingParams ** )0x28fb10 )
06-22-2016 12:09:21 UnloadFCEngine: end

No message about an unreleased ImageLoadingParams object. I know I've seen this work in earlier versions. What am I missing?

thanks/jeff

0

Comments

1 comment

  • Avatar
    Anna Falevskaya

    Hi Jeff,

    Thank you very much for your attentiveness and for your report!

    The Help contains incorrect information, we apologize for the inconvenience. This is expected behavior: the list of not released objects isn't displayed in the log because in environments with GC (.Net, Java) there is no possibility to separate real leaks from objects that are holded by GC, so in such environments this feature gives false information.

    In the next release of FCE 11 (FCE 11 R3) we will add the specific method of logging that would allow to detect unreleased objects.

    0
    Comment actions Permalink

Please sign in to leave a comment.