Freeing a TXDataclient does not actually free it

When I do something like this in an XData client when the server is not running:

  Try
    Client:= TXDataclient.Create;
  Except
    on E: EWinHttpClientException do
    begin
      Showmessage(E.Message);
      client.Free;
    end;
  End;

The client.Free statement is carried out, but the client is not really freed. When I test if Client = nil the response is False.
How can I detect if the Client works correct and is connected to the Server?

Calling client.Free only destroy the object but doesn't nil the reference. This is pure Delphi, not XData related. If you want client variable to be set to nil, call 


 FreeAndNil(client);

Of course. I should have thought of that myself.... Thank you, Wagner.