pastojs: fixed freeing temp intf var if nil

This commit is contained in:
mattias 2021-01-19 21:52:31 +00:00
parent 5810175e08
commit 51e72b06c9

View File

@ -738,15 +738,20 @@ var rtl = {
delete this[id];
old._Release(); // may fail
}
this[id]=intf;
if(intf) {
this[id]=intf;
}
return intf;
},
free: function(){
//console.log('rtl.intfRefs.free...');
for (var id in this){
if (this.hasOwnProperty(id)){
//console.log('rtl.intfRefs.free: id='+id+' '+this[id].$name+' $o='+this[id].$o.$classname);
this[id]._Release();
var intf = this[id];
if (intf){
//console.log('rtl.intfRefs.free: id='+id+' '+intf.$name+' $o='+intf.$o.$classname);
intf._Release();
}
}
}
}