From 32ce555c9daff2d4044c041e220fde44cf4aff67 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 2 Sep 2024 08:48:21 +0200 Subject: Explicitly .delete() one more interface object in uno.js ...accidentally left over from 91842724235bca73690d67d8084ec7581512d791 "Explicitly .delete() type and interface objects in uno.js" Change-Id: I84b1b7b5ee283a1a87f5d3aa894776b1bf23c607 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172731 Reviewed-by: Stephan Bergmann Tested-by: Jenkins --- static/emscripten/uno.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'static/emscripten') diff --git a/static/emscripten/uno.js b/static/emscripten/uno.js index 6591a7441220..714dbf20dc3a 100644 --- a/static/emscripten/uno.js +++ b/static/emscripten/uno.js @@ -40,10 +40,13 @@ Module.unoObject = function(interfaces, obj) { obj.queryInterface = function(type) { for (const i in obj.impl_typemap) { if (i === type.toString()) { - return new Module.uno_Any( - type, - Module['uno_Type_' + i.replace(/\./g, '$')].reference( - obj.impl_interfaces[obj.impl_typemap[i]])); + const ifc = Module['uno_Type_' + i.replace(/\./g, '$')].reference( + obj.impl_interfaces[obj.impl_typemap[i]]); + try { + return new Module.uno_Any(type, ifc); + } finally { + ifc.delete(); + } } } const ty = Module.uno_Type.Void(); -- cgit