Where is pos deleted?  We discourage the use of raw pointers, we prefer using boost::shared_ptr for memory management.