Jump to content


Config loaded twice


  • Please log in to reply
2 replies to this topic

#1 Bani Greyling

Bani Greyling

    GCS Core Developer

  • Members
  • PipPipPip
  • 190 posts
  • Country: flag of South Africa South Africa


Posted 14 August 2010 - 12:49 PM

I see the configurations get loaded twice. It caused problems for me in that timer got set up twice. To work around this issue I added a flag to to prevent a second load. Not sure if other devs experienced the same.

I attached 2 stack traces to point this out.

Attached Files


What I cannot create, I do not understand - Richard Feynman

#2 PeterG

PeterG

    GCS Core Developer

  • Members
  • PipPipPip
  • 105 posts
  • Country: flag of Sweden Sweden

Posted 14 August 2010 - 01:18 PM

View PostBani Greyling, on 14 August 2010 - 12:49 PM, said:

I see the configurations get loaded twice. It caused problems for me in that timer got set up twice. To work around this issue I added a flag to to prevent a second load. Not sure if other devs experienced the same.

I attached 2 stack traces to point this out.

loadConfiguration() can be called several times, it is called every time a user chooses a different configuration in the dropdown list. If you need to do something only once, why not do it in the constructor? In general, the idea is that a gadget when loadConfiguration() is called 1. needs to unload the current configuration if necessary, and 2. load the new configuration. Most gadgets can just overwrite the old configuration variables and then 1. is pretty much nothing.

#3 Bani Greyling

Bani Greyling

    GCS Core Developer

  • Members
  • PipPipPip
  • 190 posts
  • Country: flag of South Africa South Africa


Posted 14 August 2010 - 08:01 PM

thanks Peter...

I'll make it work in that context then...
What I cannot create, I do not understand - Richard Feynman