XAdES problem - polish KSEF - C++Builder - 5.1.0.4

I've got error "stack overflow' in line with GenerateSignature.

TXAdES* Xades = new TXAdES;
Xades->Password = Authaplikacja1!;
Xades->KeyFilePath = "D:\\ksef_cert\\auth.key";
Xades->CertFilePath = "D:\\ksef_cert\\auth.crt";
Xades->PKCS11Param->isToken = false;
Xades->Packaging = enveloped;
Xades->Template = xPlEnveloped;
Xades->GenerateSignature("a.txt", "b.xml");
delete Xades

What could be the problem ?

The problem is with SHA2.

In HashObj.pas:

constructor TSHA2Hash.Create(hashSize: THashSize; inputFormat, outputFormat: TConvertType;
  uni: TUnicode);
begin
//  inherited Create(Self); /////////////////////////////// comment or delete this line and it should work fine then