// DUMMY FUNCTION FOR ANGELSCRIPTS HANDLES void Addref(void*){}void Release(void*){}mASEngine->RegisterObjectBehaviour("Camera",asBEHAVE_ADDREF,"void f()",asFUNCTION(Addref),asCALL_CDECL_OBJLAST);mASEngine->RegisterObjectBehaviour("Camera",asBEHAVE_RELEASE,"void f()",asFUNCTION(Release),asCALL_CDECL_OBJLAST);
As for parameter references; The reason for the copy of the object instead of the true object is that this was the only way I found that I could guarantee the lifetime of the object during the call. I agree that it is quite confusing, and I do indeed plan on changing it somehow. I just can't figure out the best way to do it.
Right now, I think I'll just remove input parameter references altogether from the script language, as it doesn't make sense anyway. Output parameter references will still work as a way to have multiple return values. An application will still be able to register functions that take an parameter reference as input, but the script writer will see the functions as any other, and the script engine will do the conversion as necessary.
In a future version I may change the memory management system to move away from reference counting, and instead use true garbage collection. This could possible allow me to pass the true reference, but it may also introduce other problems. I need to analyze this thuroughly so that I don't introduce new security holes by a change like this.