开发者

Visual studio 2008 release build : application crashes on basic string or basic pointer operations

开发者 https://www.devze.com 2023-01-12 23:03 出处:网络
I have a application compiled in Visual studio 2008,which runs fine in debug build. In release build , the application crashes when std开发者_Python百科::wstring assignment is done or when shared poin

I have a application compiled in Visual studio 2008,which runs fine in debug build. In release build , the application crashes when std开发者_Python百科::wstring assignment is done or when shared pointer is accessed. Any idea why this happens in release build. crash at : eg: m_name = name; //m_name and name are of type std::wstring


In debug mode, some compilers will set values of pointers to default values (like null) for example. But in release mode the value of the pointer will be whatever is on the stack at that location and will be pointing to an invalid object thus resulting in a crash.


Your problem is probably a memory corruption caused by some other part of your program. Double check that your bounds checks are correct everywhere, you can also use specialized tools like Memory Validator or Bounds Checker.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号