| 735 | } |
| 736 | |
| 737 | void 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 | |
| 769 | bool CPlugin::AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func) |
| 770 | { |
no test coverage detected