mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 11:17:04 +00:00
[API] Avoid memory leak
https://github.com/nasa/openmct/pull/1212#discussion_r81882955
This commit is contained in:
parent
b0e842863d
commit
772d24b173
@ -190,7 +190,9 @@ define([
|
||||
* @memberof module:openmct.ObjectAPI#
|
||||
*/
|
||||
ObjectAPI.prototype.observe = function (domainObject, path, callback) {
|
||||
return new MutableObject(domainObject).on(path, callback);
|
||||
var mutableObject = new MutableObject(domainObject);
|
||||
mutableObject.on(path, callback);
|
||||
return mutableObject.stopListening.bind(mutableObject);
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user