31 {
32
33 auto iter = m_objects.begin();
34 while (iter != m_objects.end()) {
35 auto object = *iter;
36 if (object == nullptr) {
37 ++iter;
38 continue;
39 }
40
41#ifdef _DEBUG
42 OutputDebugStringA("Auto Releasing Object : ");
43 OutputDebugStringA(typeid(*object).name());
44 OutputDebugStringA("...\n");
45#elif __ANDROID__
46 LOGE("Auto Releasing Object : UNKOWN...");
47#elif __linux__
48 std::cout << "Auto Releasing Object : " << typeid(*object).name() << "...\n";
49#endif
50 if (object->isUndestroyable && !killAll) {
51#ifdef WIN32
52 OutputDebugStringA("denied.\n");
53#elif __ANDROID__
54 LOGE("denied.\n");
55#endif
56 ++iter;
57 continue;
58 }
59
60 object->Exterminate();
61 iter = m_objects.erase(iter);
62 m_hashContainer.erase(object->GetHash());
63 SAFE_DELETE(object);
64#ifdef WIN32
65 OutputDebugStringA("deleted.\n");
66#elif __ANDROID__
67 LOGE("deleted.\n");
68#elif __linux__
69 std::cout << "deleted.\n";
70#endif
71 }
72
73 m_objects.erase(std::remove(m_objects.begin(), m_objects.end(), nullptr), m_objects.end());
74}