Update app.js

This commit is contained in:
Namhyeon Go 2025-08-05 17:44:34 +09:00 committed by GitHub
parent 0ab35aab7c
commit 68a57f15fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

7
app.js
View File

@ -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;
}
}