Skip to content

Commit

Permalink
Revert "Ititialize protocol only once even if called multiple times
Browse files Browse the repository at this point in the history
(preparation for #211)"
Not needed anymore: should be called only once per process
(reverted from commit 35ba23f)
  • Loading branch information
Infocatcher committed Feb 25, 2016
1 parent 5eeb61f commit 67b486d
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions protocol.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,16 @@ Components.utils.import("resource://gre/modules/Services.jsm");
var global = this;

var privateProtocol = {
initialized: false,
get compReg() {
return Components.manager
.QueryInterface(Components.interfaces.nsIComponentRegistrar);
},
init: function(_log) {
if(this.initialized)
return;
this.initialized = true;

global._log = _log;
this.compReg.registerFactory(P_CID, P_NAME, P_CONTRACTID, this);
_log("[protocol] Initialized");
},
destroy: function() {
if(!this.initialized)
return;
this.initialized = false;

this.compReg.unregisterFactory(P_CID, this);
_log("[protocol] Destroyed");
delete global._log;
Expand Down

0 comments on commit 67b486d

Please sign in to comment.