View Full Version : LUA Code crashing NR
Jlee
June 25th, 2004, 12:45 PM
I have this Lua in an IR action:
NetRemote.GoDevice('Sky','Main')
This always crashes NR. If I change the device and panel name to another panel it works OK. The MC Main panel crashes it too.
Rob H
June 25th, 2004, 01:35 PM
Does it still do it if you make Main the second panel? ie drag it further down the tree.
Later...
The only way I can reproduce this is if there are no controls on the panel that you are jumping to.
Jlee
June 25th, 2004, 02:51 PM
I tried dragging it down the list and I even tried renaming it. The panel has lots of controls on it.
Can you replicate it in my ccf?
Rob H
June 25th, 2004, 03:05 PM
I've now tried it in your CCF (replacing the jump) and yes, I can confirm that it crashes.
Jlee
June 25th, 2004, 03:10 PM
Thanks Rob. Hopefully Ben will have the answer.
Jlee
June 25th, 2004, 03:35 PM
I'm getting closer. I clicked the background on the Sky panel and cut and pasted it all into a new panel. A few buttons were left behind so I cut and pasted these into the background frame and then pasted the whole lot back again. That fixed it but I can't figure out what is wrong with my MC panel.
Jlee
June 25th, 2004, 03:46 PM
I spoke to soon. It's crashing on the Sky panel again even though I haven't changed anything. I think it's something to do with the number of controls / frames. Time to stop guessing and wait for the master.
Ben S
June 25th, 2004, 11:45 PM
I'm away tomorrow, but will download your sample ccf and run this through the debugger on Sunday to see if I can come up with an answer.
Jlee
June 29th, 2004, 05:23 AM
I'm away tomorrow, but will download your sample ccf and run this through the debugger on Sunday to see if I can come up with an answer.
Any joy with this Ben? I tried all sorts of tests with my Sky page to try and fix it with varying results. I tried deleting buttons and frames one by one and eventually it would stop crashing but I couldn't pin it down to one particular button / frame. I have a feeling it's a memory issue of some sort but can't get consistent results from the tests I've done.
By the way - all of this relates to Win32. I haven't tried any of it on my ppc yet.
Ben S
June 30th, 2004, 11:07 PM
None yet. I apologize for the delay. I hope to have an answer for you tomorrow evening.
Ben S
July 1st, 2004, 09:14 AM
Can you point me towards the specific button that causes this? I have your newest CCF in hand, but don't see anything like this.
Rob H
July 1st, 2004, 09:33 AM
You need to tweak the CCF to show it. On the Home panel, edit the Sky tab to call NetRemote.GoDevice('Sky', 'Main') instead of the jump.
Jlee
July 1st, 2004, 09:44 AM
Thanks Rob. I just created a dummy panel and copied all of my sky panel to it. Then I created a button with the lua to jump to that panel. I one by one deleted buttons / frames from the dummy panel until it stopped crashing.
Ben S
July 1st, 2004, 01:36 PM
Found the issue, which was caused by two things -
LUA being called OnAction versus OnReleaseAction. A jump needs to occur on release, not on action.
NR was trying to repaint the button in it's upstate once the button had been destroyed.
There were two IR codes for lua: 7,0 and 7,1.
7,0 was executing on Action
7,1 was executing on ReleaseAction
I've flipped the two in the next release (to fix this issue and minimize impact to existing ccfs).
Post 1.0 I will fix the issue by wrapping the button so that it cannot be destroyed "under the covers" to be repainted later. I can already see that the current code will cause an issue if someone's lua code "jumps" in response to a timer or variable changing while a button is held down.
Jlee
July 1st, 2004, 01:59 PM
Thanks Ben. I take it the next release means the one that's due tonight. Well it's already tonight here but I guess you'll need another 8 hours to catch up with us! Can't wait. :D
Cheers.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.