Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
void LMX_Free
(
   LMX_HANDLE LmxHandle
);

Parameters

LmxHandle
[in] LM-X handle.

Return values

None.

Remarks

A handle of value NULL is valid, but does not cause cleanup.

Calling any other licensing functions on the handle after this one will have undefined behavior.

Example

The following example shows the use of the LMX_Free function, which deallocates all memory that was previously allocated by the licensing system.

It is important to note that you should call this function before you leave the application that initialized a handler.

Code Block
languagecpp
main.c
#include <lmx.h>
#include <stdio.h>

LMX_HANDLE h;

int main()  
{
  LMX_FEATURE_INFO FI;
  LMX_STATUS s;

  exit_on_error(LMX_Init(&h));
  if ((s = LMX_GetFeatureInfo(h,"nonExistingFeature", &FI)) != LMX_SUCCESS) 
  {
    if (h != NULL) 
    {
      fprintf(stderr, "%s\n", LMX_GetErrorMessage(h));
      LMX_Free(h);
  else 
  } else {
      fprintf(stderr, "%s\n", LMX_GetErrorMessageSimple(s));
      fflush(stderr);
      exit(return 1);
    }
  }
  LMX_Free(h);
  return 0;
}
}