diff --git a/app.js b/app.js index 38e8b78..ceee604 100644 --- a/app.js +++ b/app.js @@ -189,10 +189,17 @@ if (typeof CreateObject === "undefined") { if (typeof UseObject === "undefined") { var UseObject = function(progId, callback) { + var _dispose = function(obj) { + try { + obj.Close(); + } catch (e) { /* ignore */ } + }; + var obj = CreateObject(progId); try { return callback(obj); } finally { + _dispose(obj); obj = null; } }