我遇到過xutility
的unhandled exception
內xutility
未處理的異常錯誤
if (_Myproxy != 0)
{ // proxy allocated, drain it
_Lockit _Lock(_LOCK_DEBUG);
for (_Iterator_base12 **_Pnext = &_Myproxy->_Myfirstiter;
*_Pnext != 0; *_Pnext = (*_Pnext)->_Mynextiter)
(*_Pnext)->_Myproxy = 0; <------- unhandled exception here
_Myproxy->_Myfirstiter = 0;
}
我沒有控制。這unhandled exception
火車從
std::string BinarySearchFile::readT(long filePointerLocation, long sizeOfData)
{
try{
if(binary_search_file){
std::string data;
binary_search_file.seekp(filePointerLocation);
binary_search_file.seekg(filePointerLocation);
binary_search_file.read(reinterpret_cast<char *>(&data), sizeOfData);
return data; <------- branch into xutility and subsequent unhandled exception
}else if(binary_search_file.fail()){
throw CustomException("Attempt to read attribute error");
}
}
catch(CustomException &custom_exception){ // Using custom exception class
std::cout << custom_exception.what() << std::endl;
}
}
通常莖,該return
將着手
std::string BinarySearchFile::read_data(long filePointerLocation, long sizeOfData){
return readT(filePointerLocation, sizeOfData);
}
並隨後返回到原來的呼叫
attributeValue = data_file->read_data(index, size);
我在做什麼錯?
「未處理的異常」是一個非常絕望的診斷,你需要告訴你對它的瞭解。調試器向您顯示有關異常的詳細信息。一般來說,避免認爲這與xutility有關,你的程序破壞堆是標準的解釋。 –
從我上面發佈的代碼(代碼),你認爲會損壞堆?我只是將二進制數據讀入'std :: string'並將其返回給調用者。 – Mushy
你在某處毀了內存。你的[testcase](http://sscce.org)在哪裏? –