From: Thamm, R. <Rus...@ds...> - 2017-05-02 01:25:47
|
UNCLASSIFIED Hi Jimmy, I bit the bullet and converted my software to use your C++ library (32 bit). I was using an old version of your C library with my own C++ wrapper. It all seems to work OK. However Visual Leak Detector reports a large number of 64 byte memory leaks. I am including a code fragment in case I am doing something wrong. bool CPropertyDocument::hasProperty(const std::string &propName) { unsigned short wcstr[200]; size_t len; mbstowcs_s(&len, (wchar_t *)wcstr, 200, propName.c_str(), propName.size()); wcstr[len] = 0; wchar_t qry[200]; wcscpy_s((wchar_t *)qry,200,L"//property[@id='"); wcsncat_s((wchar_t *)qry,200,(wchar_t *)wcstr,len); wcscat_s((wchar_t *)qry,200,L"']"); ap->selectXPath(qry); int result = ap->evalXPath(); ap->resetXPath(); if (result == -1) { return false; } return true; } Output from VLD ---------- Block 3980 at 0x001C0610: 64 bytes ---------- Call Stack: c:\thirdpartylibs\cpp\ximpleware-2.12-c++\vtd-xml\xpathparser.yy (302): yy::xpathParser::parse c:\thirdpartylibs\cpp\ximpleware-2.12-c++\vtd-xml\xpath_driver.cc (60): xpath_driver::parse c:\thirdpartylibs\cpp\ximpleware-2.12-c++\vtd-xml\autopilot.cpp (525): com_ximpleware::AutoPilot::selectXPath c:\myprojects\msvc\hil\subsystem\rtobject\propertydocument.cpp (182): CPropertyDocument::hasProperty I get similar for all calls to selectXPath. Am I doing something wrong? Cheers Russell IMPORTANT: This email remains the property of the Department of Defence and is subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have received this email in error, you are requested to contact the sender and delete the email. |