Does anyone know when these messages occur

Lee's icon

Hi, I'm spuriously getting the following 2 messages:

method api_handlemessage called on invalid object
typedmess: api_handlemessage: corrupt object

Can anyone shed some light on when these could happen - these are occuring in max4live devices I have..... I'm guessing it's some kind of timing issue, but as I'm not sure exactly what is going on in the api_handlemessage stuff, hard to track down....

cheers, Lee

Jeremy's icon

I can't tell you exactly what's causing these, but it points to Live API activity from Max into Live at some point when the object representing the device itself isn't valid. The obvious thing to check is whether you are using "loadbang" instead of "live.thisdevice" to trigger API stuff. Same goes for trying to use the Live API in JS global code or in a JS "loadbang" function. Also check your closebang/savebang usage -- I'm not sure offhand if those might cause problems, and I doubt it, but those would be the places to check for extra API calls.

Otherwise, you'll need to post or privately mail an example with reproduction steps.

Thanks, Jeremy

Lee's icon

cheers for the pointers Jeremy - as far as the 'method api_handlemessage called on invalid object' messages, i had loads of JS LiveApi objects listening to properties of the set - clearing these down before the set closed got rid of all those messages...

still working on the 'method api_handlemessage called on invalid object' messages - bizzarely enough, when i fixed the other problem, the number of these went drastically up....

Jay Walker's icon

Hello! I'm a little bit confused about this.. I use live.numbox and live.buttons to trigger js code. These by default seem to bang in mysterious ways. Even if I don't introduce an actual loadbang, just having a numbox connected to prepend function and tied to JS functions the same as if it were a loadbang. Could this be why I'm getting this handlemessage error and my sets are randomly crashing?

cupcake's icon

Getting these errors here Max 7.3.5/Live 9.7.7 using LiveAPI in js.

Calling the API object from a function banged from live.thisdevice. No idea why i'm getting the error. No crashes, but still annoying. Cannot trace cause.

Josh Ball's icon

Does anyone have any ideas on this one? I'm also getting same issue and can't trace the problem.

I'm calling some JS with a [live.thisdevice], and using the API to get and set the name property a couple times.

Josh Ball's icon

I have a feeling it comes from memory corruption when updating a path to an API object with a new path. It only seems to happen when I try to overwrite an object with a new path that already has an observer connected. I'm going to look in to this further but it seems to be something along those lines. If anyone else has any ideas that would be cool.