SetInterval Error on Server Restart

You think you've found a bug? Please report it here.

Moderators: Lapo, Bax

Post Reply
Ganius
Posts: 92
Joined: 13 Feb 2007, 12:49

SetInterval Error on Server Restart

Post by Ganius »

I have come across this issue a few times now, so I felt it worth reporting...

On my server side extension, I keep a number of global arrays, which I use SetInterval() to check and change on a regular basis. There seems to be no problem when these arrays are empty, but if there is data inside one of the arrays and I change and save my extension, the array still contains the old information.

Firstly I would have assumed that the array gets wiped clean when reloading the extension. If not, that's fine - it's obviously being held in the machines memory. So to remove this array from memory, I use the admin tool to restart SmartFox Server.

The problem is that when SFS starts back up, the following error keeps pumping out:

Code: Select all

2007/03/21 12:35:05.485 - [ WARNING ] [id: 19] (JavascriptExtension$IntervalExecutor.run): SetInterval Error: Wrapped java.lang.NullPointerException (myextension.as#231)
2007/03/21 12:35:05.485 - [ WARNING ] [id: 19] (JavascriptExtension.logASError): Error in extension [ myextension.as ]: Wrapped java.lang.NullPointerException (myextension.as#231) Internal: -1044 -- Line number:  (MainLib line: 231)
The only way I can get rid of this is to reboot the entire machine that SFS is running on. Then everything runs perfectly.

Currently it's not that big of an issue, and I imagine in a production environment that I won't be changing the extension too much, but I felt it worth reporting...

Cheers,
G.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

are you clearing the interval(s) with clearInterval in the destroy() method of your extension?
Lapo
--
gotoAndPlay()
...addicted to flash games
Ganius
Posts: 92
Joined: 13 Feb 2007, 12:49

Post by Ganius »

It seems I had forgotten to clear one of my Intervals, and now all seems fine.

Thanks!!

G.
Post Reply