I didn't look closely at this patch, but `t` might end up holding the last reference to the session, so unless you've prepared otherwise, `sess` might be dead after this call.