C: Destroy Broker Components

When you are done using any TRPCBroker component, you should call its destroy method to free it from memory.

To destroy TRPCBroker components from your C program:

  1. Make sure the TRPCBroker component is not connected.
    RPCBPropSet(RPCBroker, "Connected", "0");
  2. Call the RpcbFree method to destroy the object.
    RPCBFree(RPCBroker); //Destroy RPCBroker component instance
  3. When you have destroyed all TRPCBroker components, but before your application terminates, you should call the Windows API FreeLibrary function to unload the DLL.
    FreeLibrary(hLib);