diff --git a/web/shared-worker/worker/worker-crypto.js b/web/shared-worker/worker/worker-crypto.js --- a/web/shared-worker/worker/worker-crypto.js +++ b/web/shared-worker/worker/worker-crypto.js @@ -181,6 +181,8 @@ } = notificationAccountWithPicklingKey; const notificationsPrekey = notificationsInitializationInfo.prekey; + + // Memory is freed below after persisting. const session = new olm.Session(); if (notificationsInitializationInfo.oneTimeKey) { session.create_outbound( @@ -231,6 +233,7 @@ }); notificationAccount.free(); + session.free(); return { message, messageType }; }