memory problem with Stamp annotation
Posted: Mon Apr 26, 2021 1:49 pm
Hi,
I use c++ coreApi sdk. I implement add Stamp annotation to pdf and after start closing my application problem with memory begin (crash and create hs-* error file) .
I use like code for create new stamp annotation (it is not full but this part is enough for reproduce problem):
PXC::ULONG_T nAtom;
hr = g_COS->StrToAtom(L"Stamp", &nAtom);
PXC::PXC_Rect rcAnnotRect;
setRecAnnot(rcAnnotRect, x, y, w, h, W, H, rot);
CComPtr<PXC::IPXC_Annotation> annot;
hr = pPage->InsertNewAnnot(nAtom, &rcAnnotRect, -1, &annot);
If this part is used my application generate file hs_err_pid*.log. I investigated problem and found that this code is used FinalizeSDK() (from your examples) throw exeption. If name of annotation is changed to "FreeText" for example (hr = g_COS->StrToAtom(L"FreeText", &nAtom); ) FinalizeSDK() do not throw exeption.
p.s. hs_err_pid*.log has not any good info about problem.
Thanks,
Evgeny.
I use c++ coreApi sdk. I implement add Stamp annotation to pdf and after start closing my application problem with memory begin (crash and create hs-* error file) .
I use like code for create new stamp annotation (it is not full but this part is enough for reproduce problem):
PXC::ULONG_T nAtom;
hr = g_COS->StrToAtom(L"Stamp", &nAtom);
PXC::PXC_Rect rcAnnotRect;
setRecAnnot(rcAnnotRect, x, y, w, h, W, H, rot);
CComPtr<PXC::IPXC_Annotation> annot;
hr = pPage->InsertNewAnnot(nAtom, &rcAnnotRect, -1, &annot);
If this part is used my application generate file hs_err_pid*.log. I investigated problem and found that this code is used FinalizeSDK() (from your examples) throw exeption. If name of annotation is changed to "FreeText" for example (hr = g_COS->StrToAtom(L"FreeText", &nAtom); ) FinalizeSDK() do not throw exeption.
p.s. hs_err_pid*.log has not any good info about problem.
Thanks,
Evgeny.