Boost 1.35 weak_ptr::lock

Hello, I'm trying to update my codes Boost from 1.34.1 to 1.35 and I'm getting a test case failure dealing with weak_ptr. I have an std::vector of weak_ptr's and I've verified that the weak_ptr that get put in are valid. Then later I look through the whole vector and lock the weak_ptr's to call a virtual method on them. The weak_ptr says it's (!expired) and the (shared_ptr == true). But the vtable is all messed up and the shared_ptr's px is not a pointer to something I made the weak_ptr from. Soo... is there any idea about why the weak_ptr from 1.35 would do this when the weak_ptr from 1.34.1 works fine? The headers look remarkably the same so I have no idea. Thanks, Aaron

Clarke, Aaron:
Hello,
I'm trying to update my codes Boost from 1.34.1 to 1.35 and I'm getting a test case failure dealing with weak_ptr. I have an std::vector of weak_ptr's and I've verified that the weak_ptr that get put in are valid. Then later I look through the whole vector and lock the weak_ptr's to call a virtual method on them. The weak_ptr says it's (!expired) and the (shared_ptr == true). But the vtable is all messed up and the shared_ptr's px is not a pointer to something I made the weak_ptr from.
Soo... is there any idea about why the weak_ptr from 1.35 would do this when the weak_ptr from 1.34.1 works fine? The headers look remarkably the same so I have no idea.
Odd. Which compiler, platform? Does this happen in a small test case that you can post?

Thanks Dimitri I figured out the problem. It was a recursive function and the vector of weak_ptrs was getting edited while inside of a BOOST_FOREACH and the vector
Hello,
I'm trying to update my codes Boost from 1.34.1 to 1.35 and I'm getting a test case failure dealing with weak_ptr. I have an std::vector of weak_ptr's and I've verified that the weak_ptr that get put in are valid. Then later I look through the whole vector and lock the weak_ptr's to call a virtual method on them. The weak_ptr says it's (!expired) and the (shared_ptr == true). But the vtable is all messed up and the shared_ptr's px is not a pointer to something I made the weak_ptr from.
Soo... is there any idea about why the weak_ptr from 1.35 would do this when the weak_ptr from 1.34.1 works fine? The headers look remarkably the same so I have no idea.
Odd. Which compiler, platform? Does this happen in a small test case that you can post? _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Clarke, Aaron
-
Peter Dimov