0

有时,std::map 会发生访问冲突,我不知道为什么!我在 64 位应用程序上使用 VS 2010。如果有人有想法?

这是我的调用堆栈:

std::_Tree >,0> >::_Lbound(const pureCore::Core::DependencyProperty * const & _Keyval=0x0000000002514244) 第 1745 行 + 0xa 字节 C++ std::_Tree >,0> >::lower_bound(const pureCore: :Core::DependencyProperty * const & _Keyval=0x0000000002514244) 第 1450 行 + 0xf 字节 C++ std::_Tree >,0> >::find(const pureCore::Core::DependencyProperty * const & _Keyval=0x0000000002514244) 第 1424 行 + 0x1a字节 C++

这是我的代码:

AnyObject value = AnyNull;
if (_propertiesValues.find(property) != _propertiesValues.end())
  value = _propertiesValues[property];

它在以下行的文件“xtree”中崩溃:“while (!this->_Isnil(_Pnode))”。我认为没有什么特别的......这段代码大部分时间都可以工作......但有时(很少)它会崩溃!

_Nodeptr _Lbound(const key_type& _Keyval) { // 找到不小于 _Keyval 的最左边节点 _Nodeptr _Pnode = _Root(); _Nodeptr _Wherenode = this->_Myhead; // end() 如果搜索失败

  while (!this->_Isnil(_Pnode))           if (_DEBUG_LT_PRED(this->comp,

this->_Key(_Pnode), _Keyval)) _Pnode = this->_Right(_Pnode); // 下降右子树 else { // _Pnode 不小于 _Keyval,记住它 _Wherenode = _Pnode; _Pnode = this->_Left(_Pnode); // 下降左子树 }

  return (_Wherenode);    // return best remembered candidate         }
4

0 回答 0