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

Method DropEverything

core/logic/PluginSys.cpp:737–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

735}
736
737void CPlugin::DropEverything()
738{
739 CPlugin *pOther;
740 List<WeakNative>::iterator wk_iter;
741
742 /* Tell everyone that depends on us that we're about to drop */
743 for (List<CPlugin *>::iterator iter = m_Dependents.begin();
744 iter != m_Dependents.end();
745 iter++)
746 {
747 pOther = static_cast<CPlugin *>(*iter);
748 pOther->DependencyDropped(this);
749 }
750
751 /* Note: we don't care about things we depend on.
752 * The reason is that extensions have their own cleanup
753 * code for plugins. Although the "right" design would be
754 * to centralize that here, i'm omitting it for now. Thus,
755 * the code below to walk the plugins list will suffice.
756 */
757
758 /* Other plugins could be holding weak references that were
759 * added by us. We need to clean all of those up now.
760 */
761 g_PluginSys.ForEachPlugin([this] (CPlugin *other) -> void {
762 other->ToNativeOwner()->DropRefsTo(this);
763 });
764
765 /* Proceed with the rest of the necessities. */
766 CNativeOwner::DropEverything();
767}
768
769bool CPlugin::AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func)
770{

Callers 2

UnloadExtensionMethod · 0.45
PurgeMethod · 0.45

Calls 6

DependencyDroppedMethod · 0.80
ForEachPluginMethod · 0.80
DropRefsToMethod · 0.80
ToNativeOwnerMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected