Bug 1029738 - Halt firing instrumented function calls after destruction in CallWatcherActor. r=vp

This commit is contained in:
Jordan Santell 2014-06-30 11:42:00 +02:00
Родитель 82839e29d0
Коммит 94b2961f58
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -318,6 +318,7 @@ let CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass({
return;
}
this._initialized = false;
this._finalized = true;
this._contentObserver.stopListening();
off(this._contentObserver, "global-created", this._onGlobalCreated);
@ -534,6 +535,11 @@ let CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass({
* Invoked whenever an instrumented function is called.
*/
_onContentFunctionCall: function(...details) {
// If the consuming tool has finalized call-watcher, ignore the
// still-instrumented calls.
if (this._finalized) {
return;
}
let functionCall = new FunctionCallActor(this.conn, details, this._holdWeak);
this._functionCalls.push(functionCall);
this.onCall(functionCall);