Confusion about the stack trace of websocketpp destruction

171 Views Asked by At

I'm using Instrument(XCode tool) to get the stack trace of my program and i got the following result:

enter image description here

In this picture it shows that the destruction of

std::__1::vector<websocketpp::transport::buffer, std::__1::allocator<websocketpp::transport::buffer> >::~vector()

called the

std::__1::vector<boost::asio::detail::timer_queue<boost::asio::detail::chrono_time_traits<std::__1::chrono::steady_clock, boost::asio::wait_traits<std::__1::chrono::steady_clock> > >::heap_entry, std::__1::allocator<boost::asio::detail::timer_queue<boost::asio::detail::chrono_time_traits<std::__1::chrono::steady_clock, boost::asio::wait_traits<std::__1::chrono::steady_clock> > >::heap_entry> >::~vector()

However, when I dig into the source code of websocketpp::transport::buffer, its only member was char const *buf and size_t len showed below:

// defined in websocketpp/transport/base/connection.hpp

137 /// A simple utility buffer class
138 struct buffer {
139     buffer(char const * b, size_t l) : buf(b),len(l) {}
140
141     char const * buf;
142     size_t len;
143 }; 

So, why destruction of websocketpp::transport::buffer could cause the destruction of the vector<boost::asio::detail::timer_queue.... ::heap_entry> >?

Update: 2018-10-18

Today I used lldb to debug my program, found that the destruction of the vector<boost::asio::detail::timer_queue.... ::heap_entry> > was never be executed yet.

i feel more confused now...

0

There are 0 best solutions below