| 506 | } |
| 507 | |
| 508 | void DBManager::OnSourceModIdentityDropped(IdentityToken_t *pToken) |
| 509 | { |
| 510 | s_pAddBlock = pToken; |
| 511 | |
| 512 | /* Kill the thread so we can flush everything into the think queue... */ |
| 513 | KillWorkerThread(); |
| 514 | |
| 515 | /* Run all of the think operations. |
| 516 | * Unlike the driver unloading example, we'll let these calls go through, |
| 517 | * since a plugin unloading is far more normal. |
| 518 | */ |
| 519 | Queue<IDBThreadOperation *>::iterator iter = m_ThinkQueue.begin(); |
| 520 | Queue<IDBThreadOperation *> templist; |
| 521 | while (iter != m_ThinkQueue.end()) |
| 522 | { |
| 523 | IDBThreadOperation *op = (*iter); |
| 524 | if (op->GetOwner() == pToken) |
| 525 | { |
| 526 | templist.push(op); |
| 527 | iter = m_ThinkQueue.erase(iter); |
| 528 | } else { |
| 529 | iter++; |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | for (iter = templist.begin(); |
| 534 | iter != templist.end(); |
| 535 | iter++) |
| 536 | { |
| 537 | IDBThreadOperation *op = (*iter); |
| 538 | op->RunThinkPart(); |
| 539 | op->Destroy(); |
| 540 | } |
| 541 | |
| 542 | s_pAddBlock = NULL; |
| 543 | } |
| 544 | |
| 545 | void DBManager::OnPluginWillUnload(IPlugin *plugin) |
| 546 | { |
no test coverage detected