mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-22 14:09:09 +02:00
pastojs: fixed freeing temp intf var if nil
This commit is contained in:
parent
5810175e08
commit
51e72b06c9
11
compiler/utils/pas2js/dist/rtl.js
vendored
11
compiler/utils/pas2js/dist/rtl.js
vendored
@ -738,15 +738,20 @@ var rtl = {
|
|||||||
delete this[id];
|
delete this[id];
|
||||||
old._Release(); // may fail
|
old._Release(); // may fail
|
||||||
}
|
}
|
||||||
this[id]=intf;
|
if(intf) {
|
||||||
|
this[id]=intf;
|
||||||
|
}
|
||||||
return intf;
|
return intf;
|
||||||
},
|
},
|
||||||
free: function(){
|
free: function(){
|
||||||
//console.log('rtl.intfRefs.free...');
|
//console.log('rtl.intfRefs.free...');
|
||||||
for (var id in this){
|
for (var id in this){
|
||||||
if (this.hasOwnProperty(id)){
|
if (this.hasOwnProperty(id)){
|
||||||
//console.log('rtl.intfRefs.free: id='+id+' '+this[id].$name+' $o='+this[id].$o.$classname);
|
var intf = this[id];
|
||||||
this[id]._Release();
|
if (intf){
|
||||||
|
//console.log('rtl.intfRefs.free: id='+id+' '+intf.$name+' $o='+intf.$o.$classname);
|
||||||
|
intf._Release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user