internal
| 474 | |
| 475 | // internal |
| 476 | void asCModule::UninitializeGlobalProp(asCGlobalProperty *prop) |
| 477 | { |
| 478 | if (prop == 0) |
| 479 | return; |
| 480 | |
| 481 | if (prop->type.IsObject()) |
| 482 | { |
| 483 | void **obj = (void**)prop->GetAddressOfValue(); |
| 484 | if (*obj) |
| 485 | { |
| 486 | asCObjectType *ot = CastToObjectType(prop->type.GetTypeInfo()); |
| 487 | |
| 488 | if (ot->flags & asOBJ_REF) |
| 489 | { |
| 490 | asASSERT((ot->flags & asOBJ_NOCOUNT) || ot->beh.release); |
| 491 | if (ot->beh.release) |
| 492 | m_engine->CallObjectMethod(*obj, ot->beh.release); |
| 493 | } |
| 494 | else |
| 495 | { |
| 496 | if (ot->beh.destruct) |
| 497 | m_engine->CallObjectMethod(*obj, ot->beh.destruct); |
| 498 | |
| 499 | m_engine->CallFree(*obj); |
| 500 | } |
| 501 | |
| 502 | // Set the address to 0 as someone might try to access the variable afterwards |
| 503 | *obj = 0; |
| 504 | } |
| 505 | } |
| 506 | else if (prop->type.IsFuncdef()) |
| 507 | { |
| 508 | asCScriptFunction **func = (asCScriptFunction**)prop->GetAddressOfValue(); |
| 509 | if (*func) |
| 510 | { |
| 511 | (*func)->Release(); |
| 512 | *func = 0; |
| 513 | } |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | // internal |
| 518 | void asCModule::CallExit() |
nothing calls this directly
no test coverage detected