Skip to content

Commit

Permalink
Trying something to keep garbage collector at bay
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacSchemm committed Feb 21, 2017
1 parent 7a67307 commit 97f2fd4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions components/WebRTCToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ WebRTCToggle.prototype = {

// add to category manager
_xpcom_categories: [{category: "profile-after-change"}],

prefBranch: null,

observe: function(aSubject, aTopic, aData)
observe: function(aSubject, aTopic, aData)
{
switch (aTopic)
{
Expand All @@ -58,10 +60,10 @@ WebRTCToggle.prototype = {
.getService(Components.interfaces.nsIObserverService)
.addObserver(this, "quit-application", false);

Components.classes["@mozilla.org/preferences-service;1"]
this.prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService)
.getBranch("media.navigator.permission.")
.addObserver("", this, false);
.getBranch("media.navigator.permission.");
this.prefBranch.addObserver("", this, false);
break;
case "quit-application":
// Turn the override off when closing the application,
Expand All @@ -86,6 +88,7 @@ WebRTCToggle.prototype = {
} else {
message = "Automatic WebRTC connection has been turned off.";
}
console.log(message);

var type = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService)
Expand Down

0 comments on commit 97f2fd4

Please sign in to comment.