interface
| 5713 | |
| 5714 | // interface |
| 5715 | void asCScriptEngine::AddRefScriptObject(void *obj, const asITypeInfo *type) |
| 5716 | { |
| 5717 | // Make sure it is not a null pointer |
| 5718 | if( obj == 0 || type == 0 ) return; |
| 5719 | |
| 5720 | const asCTypeInfo *ti = reinterpret_cast<const asCTypeInfo*>(type); |
| 5721 | if (ti->flags & asOBJ_FUNCDEF) |
| 5722 | { |
| 5723 | CallObjectMethod(obj, functionBehaviours.beh.addref); |
| 5724 | } |
| 5725 | else |
| 5726 | { |
| 5727 | asCObjectType *objType = CastToObjectType(const_cast<asCTypeInfo*>(ti)); |
| 5728 | if (objType && objType->beh.addref) |
| 5729 | { |
| 5730 | // Call the addref behaviour |
| 5731 | CallObjectMethod(obj, objType->beh.addref); |
| 5732 | } |
| 5733 | } |
| 5734 | } |
| 5735 | |
| 5736 | // interface |
| 5737 | void asCScriptEngine::ReleaseScriptObject(void *obj, const asITypeInfo *type) |