
12 Sep
2008
12 Sep
'08
10:36 p.m.
AMDG PingShan Li wrote:
Here is my test program using boost::thread. I would expect this program to crash inside FunctionA because m_ClassA is no longer available.
Can anybody help me to understand why it does not crash? thank you.
Incorrect programs are not guaranteed to crash. The memory for m_ClassA is on the main thread's stack and is almost certain to still be valid (at the machine level) when FunctionA is called. In fact, depending on your compiler it may not have been overwritten at all. In Christ, Steven Watanabe