mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-09 18:11:50 +00:00
fixed dynamic port forward listener not getting cleaned up - fixes #4200
This commit is contained in:
@@ -21,7 +21,7 @@ function isStructuralMember (v) {
|
||||
}
|
||||
|
||||
function isNonStructuralObjectMember (v): boolean {
|
||||
return v instanceof Object && !(v instanceof Array) && v.__nonStructural
|
||||
return v instanceof Object && (v instanceof Array || v.__nonStructural)
|
||||
}
|
||||
|
||||
/** @hidden */
|
||||
@@ -62,18 +62,18 @@ export class ConfigProxy {
|
||||
if (real[key] !== undefined) {
|
||||
return real[key]
|
||||
} else {
|
||||
if (isNonStructuralObjectMember(defaults[key])) {
|
||||
// The object might be modified outside
|
||||
real[key] = this.__getDefault(key)
|
||||
delete real[key].__nonStructural
|
||||
return real[key]
|
||||
}
|
||||
return this.__getDefault(key)
|
||||
}
|
||||
}
|
||||
|
||||
this.__getDefault = (key: string) => { // eslint-disable-line @typescript-eslint/unbound-method
|
||||
if (isNonStructuralObjectMember(defaults[key])) {
|
||||
real[key] = { ...defaults[key] }
|
||||
delete real[key].__nonStructural
|
||||
return real[key]
|
||||
} else {
|
||||
return deepClone(defaults[key])
|
||||
}
|
||||
return deepClone(defaults[key])
|
||||
}
|
||||
|
||||
this.__setValue = (key: string, value: any) => { // eslint-disable-line @typescript-eslint/unbound-method
|
||||
|
Reference in New Issue
Block a user