Am I correct in assuming that the asIObjectType user data is per-type and not per-object? Is it possible to somehow register per-object user data?
I register all my application (ref) types as nocount ones like so:
RegisterObjectType("MyObj", 0, asOBJ_REF | asOBJ_NOCOUNT);
Sometimes users run into object lifetime issues where the underlying C++ object (e.g. a MyObj instance) has gone away, but a script is still holding on to a handle to it and attempting to call (C++) member functions through that (now-stale) pointer crashes the application. If I had some way to append a user data to every instance of a script handle to an application-registered ref object.. I might be able to do some debug checking to ensure that the handle isn't a stale one.
Have you heard of any users doing something similar? Do you have any suggestions for managing object lifetimes when the ref types can't be reference counted?
Thank you very much.