| 928 | } |
| 929 | |
| 930 | LoadRes CPluginManager::LoadPlugin(CPlugin **aResult, const char *path, bool debug, PluginType type) |
| 931 | { |
| 932 | if (m_LoadingLocked) |
| 933 | return LoadRes_NeverLoad; |
| 934 | |
| 935 | /** |
| 936 | * Does this plugin already exist? |
| 937 | */ |
| 938 | CPlugin *pPlugin; |
| 939 | if (m_LoadLookup.retrieve(path, &pPlugin)) |
| 940 | { |
| 941 | /* Check to see if we should try reloading it */ |
| 942 | if (pPlugin->GetStatus() == Plugin_BadLoad |
| 943 | || pPlugin->GetStatus() == Plugin_Error |
| 944 | || pPlugin->GetStatus() == Plugin_Failed) |
| 945 | { |
| 946 | UnloadPlugin(pPlugin); |
| 947 | } |
| 948 | else |
| 949 | { |
| 950 | if (aResult) |
| 951 | *aResult = pPlugin; |
| 952 | return LoadRes_AlreadyLoaded; |
| 953 | } |
| 954 | } |
| 955 | |
| 956 | CPlugin *plugin = CompileAndPrep(path); |
| 957 | |
| 958 | // Assign our outparam so we can return early. It must be set. |
| 959 | *aResult = plugin; |
| 960 | |
| 961 | if (plugin->GetStatus() != Plugin_Created) |
| 962 | return LoadRes_Failure; |
| 963 | |
| 964 | if (plugin->AskPluginLoad() != APLRes_Success) |
| 965 | return LoadRes_Failure; |
| 966 | |
| 967 | LoadExtensions(plugin); |
| 968 | return LoadRes_Successful; |
| 969 | } |
| 970 | |
| 971 | IPlugin *CPluginManager::LoadPlugin(const char *path, bool debug, PluginType type, char error[], size_t maxlength, bool *wasloaded) |
| 972 | { |
no test coverage detected