| 1088 | } |
| 1089 | |
| 1090 | void Scripting::RegisterObject(ScriptingObject* obj) |
| 1091 | { |
| 1092 | PROFILE_MEM(Scripting); |
| 1093 | const Guid id = obj->GetID(); |
| 1094 | ScopeLock lock(_objectsLocker); |
| 1095 | |
| 1096 | //ASSERT(!_objectsDictionary.ContainsValue(obj)); |
| 1097 | #if ENABLE_ASSERTION |
| 1098 | #if USE_OBJECTS_DISPOSE_CRASHES_DEBUGGING |
| 1099 | ScriptingObjectData other; |
| 1100 | if (_objectsDictionary.TryGet(id, other)) |
| 1101 | #else |
| 1102 | ScriptingObject* other; |
| 1103 | if (_objectsDictionary.TryGet(id, other)) |
| 1104 | #endif |
| 1105 | { |
| 1106 | // Something went wrong... |
| 1107 | LOG(Error, "Objects registry already contains object with ID={0} (type '{3}')! Trying to register object {1} (type '{2}').", id, obj->ToString(), String(obj->GetClass()->GetFullName()), String(other->GetClass()->GetFullName())); |
| 1108 | } |
| 1109 | #endif |
| 1110 | |
| 1111 | #if USE_OBJECTS_DISPOSE_CRASHES_DEBUGGING |
| 1112 | LOG(Info, "[RegisterObject] obj = 0x{0:x}, {1}", (uint64)obj, String(ScriptingObjectData(obj).TypeName)); |
| 1113 | #endif |
| 1114 | _objectsDictionary[id] = obj; |
| 1115 | } |
| 1116 | |
| 1117 | void Scripting::UnregisterObject(ScriptingObject* obj) |
| 1118 | { |
no test coverage detected