Skip to content

Fix ecs_import MODULE_UNDEFINED assert when loading modules dynamically#2072

Open
bg5sbk wants to merge 1 commit into
SanderMertens:masterfrom
bg5sbk:fix/import-from-library-lookup
Open

Fix ecs_import MODULE_UNDEFINED assert when loading modules dynamically#2072
bg5sbk wants to merge 1 commit into
SanderMertens:masterfrom
bg5sbk:fix/import-from-library-lookup

Conversation

@bg5sbk
Copy link
Copy Markdown

@bg5sbk bg5sbk commented Apr 30, 2026

The second lookup in ecs_import() used the raw module_name (PascalCase) instead of the converted path (dot.separated). This caused ecs_import_from_library() to always fail with MODULE_UNDEFINED because ECS_MODULE registers the entity with the dot-separated path (e.g. 'physics.plugin'), but the post-import lookup searched for the PascalCase name (e.g. 'PhysicsPlugin') which doesn't exist.

Fix: use the already-converted 'path' variable for both lookups, and defer ecs_os_free(path) to the end of the function.

Fixes #2071
Fixes #1755

The second lookup in ecs_import() used the raw module_name (PascalCase)
instead of the converted path (dot.separated). This caused
ecs_import_from_library() to always fail with MODULE_UNDEFINED because
ECS_MODULE registers the entity with the dot-separated path (e.g.
'physics.plugin'), but the post-import lookup searched for the
PascalCase name (e.g. 'PhysicsPlugin') which doesn't exist.

Fix: use the already-converted 'path' variable for both lookups, and
defer ecs_os_free(path) to the end of the function.

Fixes SanderMertens#2071
Fixes SanderMertens#1755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant