| 1243 | extern Beefy::StringT<0> gDbgErrorString; |
| 1244 | |
| 1245 | void BFGC::ProcessSweepInfo() |
| 1246 | { |
| 1247 | if (mSweepInfo.mLeakCount > 0) |
| 1248 | { |
| 1249 | if (mSweepInfo.mShowAllAsLeaks) |
| 1250 | { |
| 1251 | // We aren't certain of the mark flags, so force the issue |
| 1252 | mCurMarkId = 0; |
| 1253 | for (auto obj : mSweepInfo.mLeakObjects) |
| 1254 | { |
| 1255 | obj->mObjectFlags = (BfObjectFlags)((obj->mObjectFlags & ~BF_OBJECTFLAG_MARK_ID_MASK) | mCurMarkId); |
| 1256 | } |
| 1257 | mCurMarkId = 1; |
| 1258 | } |
| 1259 | |
| 1260 | for (auto obj : mSweepInfo.mLeakObjects) |
| 1261 | { |
| 1262 | MarkMembers(obj); |
| 1263 | } |
| 1264 | |
| 1265 | //::MessageBoxA(NULL, "Leak", "Leak", MB_OK); |
| 1266 | |
| 1267 | //#if 0 |
| 1268 | Beefy::StringT<1024> errorStr = StrFormat("%d object memory leak%s detected.\nMouse over an 'i' icon in the Output panel to view a leaked object and its allocation stack trace.", |
| 1269 | mSweepInfo.mLeakCount, (mSweepInfo.mLeakCount != 1) ? "s" : ""); |
| 1270 | gDbgErrorString = errorStr; |
| 1271 | gDbgErrorString += "\n"; |
| 1272 | |
| 1273 | #ifdef BF_GC_DEBUGSWEEP |
| 1274 | Sleep(100); |
| 1275 | #endif |
| 1276 | |
| 1277 | for (int pass = 0; pass < 2; pass++) |
| 1278 | { |
| 1279 | int passLeakCount = 0; |
| 1280 | |
| 1281 | for (auto obj : mSweepInfo.mLeakObjects) |
| 1282 | { |
| 1283 | bool wantsNoRefs = pass == 0; |
| 1284 | bool hasNoRefs = (obj->mObjectFlags & BF_OBJECTFLAG_MARK_ID_MASK) != mCurMarkId; |
| 1285 | if (hasNoRefs != wantsNoRefs) |
| 1286 | continue; |
| 1287 | |
| 1288 | Beefy::String typeName = obj->GetTypeName(); |
| 1289 | |
| 1290 | if (passLeakCount == 0) |
| 1291 | { |
| 1292 | Beefy::String header = (pass == 0) ? " Unreferenced:\n" : " Referenced by other leaked objects:\n"; |
| 1293 | errorStr += "\x1"; |
| 1294 | errorStr += "TEXT\t"; |
| 1295 | errorStr += header; |
| 1296 | |
| 1297 | gDbgErrorString += header; |
| 1298 | } |
| 1299 | |
| 1300 | if (passLeakCount == 20000) // Only display so many... |
| 1301 | break; |
| 1302 |
nothing calls this directly
no test coverage detected