1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

GDExtension: Implement GDExtensionLoader concept

- Implements the concept of GDExtension loaders that can be used to customize how GDExtensions are loaded and initialized.
- Moves the parsing of `.gdextension` config files to the new `GDExtensionLibraryLoader`.
- `GDExtensionManager` is now meant to be the main way to load/unload extensions and can optionally take a `GDExtensionLoader`.
- `EditorFileSystem` avoids unloading extensions if the file still exists, this should prevent unloading extensions that are outside the user project.
This commit is contained in:
Raul Santos
2024-04-24 01:32:25 +02:00
parent 1bd740d18d
commit 4dd6e8eca5
9 changed files with 584 additions and 347 deletions

View File

@@ -2953,7 +2953,10 @@ bool EditorFileSystem::_scan_extensions() {
Vector<String> loaded_extensions = GDExtensionManager::get_singleton()->get_loaded_extensions();
for (int i = 0; i < loaded_extensions.size(); i++) {
if (!extensions.has(loaded_extensions[i])) {
extensions_removed.push_back(loaded_extensions[i]);
// The extension may not have a .gdextension file.
if (!FileAccess::exists(loaded_extensions[i])) {
extensions_removed.push_back(loaded_extensions[i]);
}
}
}