extmod/modssl_mbedtls: Reference SSLContext from SSLSocket.

Prevent the GC cleaning up (and finalising) the SSLContext while the
socket is still live.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pull/12139/head
Jim Mussared 2023-08-01 15:12:14 +10:00
rodzic 01c758e26a
commit 70c564324c
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -357,6 +357,7 @@ STATIC mp_obj_t ssl_socket_make_new(mp_obj_ssl_context_t *ssl_context, mp_obj_t
mp_obj_ssl_socket_t *o = m_new_obj(mp_obj_ssl_socket_t);
#endif
o->base.type = &ssl_socket_type;
o->ssl_context = ssl_context;
o->sock = sock;
o->poll_mask = 0;
o->last_error = 0;