Hi Michael, I'm afraid your use of shared pointers is off.
shared_ptr denotes shared ownership and, in this case the session owns the surface. It doesn't make sense for the surface to also own the session - at the very least that can create an ownership cycle (and cause a memory leak).
Having said that, as the session is guaranteed to outlive the surface I imagine an ordinary raw pointer will serve your purpose.
Hi Michael, I'm afraid your use of shared pointers is off.
shared_ptr denotes shared ownership and, in this case the session owns the surface. It doesn't make sense for the surface to also own the session - at the very least that can create an ownership cycle (and cause a memory leak).
Having said that, as the session is guaranteed to outlive the surface I imagine an ordinary raw pointer will serve your purpose.