MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / OnSourceModIdentityDropped

Method OnSourceModIdentityDropped

core/logic/Database.cpp:508–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508void 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
545void DBManager::OnPluginWillUnload(IPlugin *plugin)
546{

Callers 1

UnloadExtensionMethod · 0.45

Calls 7

beginMethod · 0.45
endMethod · 0.45
GetOwnerMethod · 0.45
pushMethod · 0.45
eraseMethod · 0.45
RunThinkPartMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected