Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. boost::shared_ptr<PointPrism> getPrismFromDirection(const Point3& direction) const
  2. {
  3. return boost::shared_ptr<PointPrism>(new PointPrism(_position, direction));
  4. }
  5.  
  6. boost::shared_ptr<PointPrism> getPrismFromAimingPoint(const Point3& aimingPoint)
  7. {
  8. boost::shared_ptr<PointPrism> prism = getPrismFromDirection((aimingPoint - _position).normalized());
  9. prism->setAimingPoint(aimingPoint);
  10. return prism;
  11. }
  12.  
  13. main()
  14. {
  15. boost::shared_ptr<Point> p; //initialized somewhere in this code
  16. boost::shared_ptr<PointPrism> prism = p->getPrismFromAimingPoint(aimingPoint);
  17.  
  18. //here it looks like the prism object is just fine
  19. boost::this_thread::sleep(boost::posix_time::seconds(10));
  20. //here both VS10 debugger and log prints show that values inside prism are corrupted
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement