https://github.com/5cript/nui-scp/blob/4edd04fb701a13ce32a225900d28ed091a68b631/ssh/source/ssh/session.cpp#L120 The shared_ptr makes no sense here. Either use the shared_ptr or just the promise and move it in.