Global Variable Disappearing/Reverting back to original state


#1

I have a global variable that I set in my main.js like so

global.tabStatus = {
  tab: {
    list: {}
  }
}

In my renderer.js I update that global by adding things to the tab.list object like so

remote.getGlobal('tabStatus').tab.list.tab1 = {...}
remote.getGlobal('tabStatus').tab.list.tab2 = {...}
...

For some reason, the variable will completely revert back to the way it looks in the first block of code. There are no patterns that reproduce the issue, and sometimes the object will revert/disappear simply after a few seconds after adding something to the list. I have a

 in my index.html that constantly displays the contents of this global variable and it literally changes before my eyes for no apparent reason, it seems.

Is the global variable being garbage collected? Or what could be causing it to revert?


#2

Not sure why I can’t edit my question but it should say this at the end:

I have a pre tag in my index.html that constantly displays the contents of this global variable and it literally changes before my eyes for no apparent reason, it seems. Is the global variable being garbage collected? Or what could be causing it to revert?