Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
greubel
Level 7

CreatObject return of invalid

I thought that CreatObject was to return an invalid if the object couldn't be created ?

o = CreateObject( "roArray", 100000, 1 )
for i=0 to 100000
x = CreateObject( "roArray", 10000, 1 )
if x = invalid exit for
o.push( x )
? i*10000
end for


It just crashes !

This was just for fun.
Need a method to tell the amount of available memory and file space

Roku could add another returned value from RunGarbageCollector() that shows available space
and have GetVolumeInfo() work for the internal file sytems.
0 Kudos
2 Replies
EnTerr
Level 8

Re: CreatObject return of invalid

Ahh, good one - i will mark it for my collection of YAWRRs. Seems to work on all platforms. Here is a shorter version:
BrightScript Debugger> dim reboot[10000, 10000]
Connection closed by foreign host.

About predicting and avoiding impending doom: I am reminded of a great, droll scifi story by Robert Sheckley, "Protection" (i wholeheartedly recommend reading it!):
"Robert Sheckley" wrote:

...the big problem is lesnerizing. I must not lesnerize. Absolutely not. As you can imagine, that hampers me.


PS. @greubel - your suggestions sound reasonable; don't know if they are falling on deaf ears though. Maybe if you describe in more detail your plight (i.e. you are trying to parse/cache big amount of media info or what-have-you), Roku* will pay attention?
0 Kudos
EnTerr
Level 8

Re: CreatObject return of invalid

So Roku* -
what's the deal with (to give concrete example) `createObject("roArray", 1234567890, false)` working on fw3 but crashing the box on fw5?

If not enough memory, the right behavior is to return `invalid` (or runtime error) - and that's what old firmware does. New one just blows up instead - a very quick reboot:
$ telnet roku4200 8085
BrightScript Debugger> x = createObject("roArray", 1234567890, false)
Connection closed by foreign host.

$ telnet roku2050 8085
BrightScript Debugger> x = createObject("roArray", 1234567890, false)
BrightScript Debugger> ? x
invalid

(See also belltown's topic viewtopic.php?f=34&t=73863 )
0 Kudos