mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-10-26 18:41:18 +00:00
Update app.js
This commit is contained in:
parent
0ab35aab7c
commit
68a57f15fb
7
app.js
7
app.js
|
|
@ -189,10 +189,17 @@ if (typeof CreateObject === "undefined") {
|
||||||
|
|
||||||
if (typeof UseObject === "undefined") {
|
if (typeof UseObject === "undefined") {
|
||||||
var UseObject = function(progId, callback) {
|
var UseObject = function(progId, callback) {
|
||||||
|
var _dispose = function(obj) {
|
||||||
|
try {
|
||||||
|
obj.Close();
|
||||||
|
} catch (e) { /* ignore */ }
|
||||||
|
};
|
||||||
|
|
||||||
var obj = CreateObject(progId);
|
var obj = CreateObject(progId);
|
||||||
try {
|
try {
|
||||||
return callback(obj);
|
return callback(obj);
|
||||||
} finally {
|
} finally {
|
||||||
|
_dispose(obj);
|
||||||
obj = null;
|
obj = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user