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 @@ -182,6 +182,8 @@ } = notificationAccountWithPicklingKey; const notificationsPrekey = notificationsInitializationInfo.prekey; + + // Memory is freed below after persisting. const session = new olm.Session(); if (notificationsInitializationInfo.oneTimeKey) { session.create_outbound( @@ -232,6 +234,7 @@ }); notificationAccount.free(); + session.free(); return { message, messageType }; }