| 194 | } |
| 195 | |
| 196 | void CObjectList::ProcessDestroyQueue() |
| 197 | { |
| 198 | // Destroy |
| 199 | if (!destroy_queue.empty()) |
| 200 | { |
| 201 | // Info |
| 202 | for (auto oit = objects_active.begin(); oit != objects_active.end(); oit++) |
| 203 | for (int it = destroy_queue.size() - 1; it >= 0; it--) |
| 204 | { |
| 205 | (*oit)->net_Relcase(destroy_queue[it]); |
| 206 | } |
| 207 | for (auto oit = objects_sleeping.begin(); oit != objects_sleeping.end(); oit++) |
| 208 | for (int it = destroy_queue.size() - 1; it >= 0; it--) |
| 209 | (*oit)->net_Relcase(destroy_queue[it]); |
| 210 | |
| 211 | for (int it = destroy_queue.size() - 1; it >= 0; it--) |
| 212 | Sound->object_relcase(destroy_queue[it]); |
| 213 | |
| 214 | auto It = m_relcase_callbacks.begin(); |
| 215 | auto Ite = m_relcase_callbacks.end(); |
| 216 | for (; It != Ite; ++It) |
| 217 | { |
| 218 | VERIFY(*(*It).m_ID == (It - m_relcase_callbacks.begin())); |
| 219 | auto dIt = destroy_queue.begin(); |
| 220 | auto dIte = destroy_queue.end(); |
| 221 | for (; dIt != dIte; ++dIt) |
| 222 | { |
| 223 | (*It).m_Callback(*dIt); |
| 224 | g_hud->net_Relcase(*dIt); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | // Destroy |
| 229 | for (int it = destroy_queue.size() - 1; it >= 0; it--) |
| 230 | { |
| 231 | CObject* O = destroy_queue[it]; |
| 232 | |
| 233 | O->setDestroy(TRUE); //https://github.com/OGSR/OGSR_Engine_private/commit/406a9d3766bbb726d39c9a73f4038634261d65a4 |
| 234 | |
| 235 | if (debug_destroy) |
| 236 | Msg("Destroying object[%x][%x] [%d][%s] frame[%d]", smart_cast<void*>(O), O, O->ID(), *O->cName(), Device.dwFrame); |
| 237 | |
| 238 | O->net_Destroy(); |
| 239 | Destroy(O); |
| 240 | } |
| 241 | destroy_queue.clear(); |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | void CObjectList::net_Register(CObject* O) |
| 246 | { |
no test coverage detected