-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Duplicate from: UQdeco2800/2021-ext-studio-2#271
Description
Entity components for a particular Screen are registered to the EntityService. When the EntityService initialized for that particular screen is disposed, the dispose() functions for each component attached to that Entity are not called. Manually calling entity.dispose() works, but ServiceLocator.getEntityService.dispose() does not work.
How to reproduce
The dispose() function of the SettingsMenuDisplay component does not get called when ServiceLocator.getEntityService().dispose() is called on the SettingsScreen, although the corresponding entity is registered to the service as we can see in the createUI() method. Disposing the entity manually in SettingsScreen's dispose() function works.
Temporary Fix
Dispose the entity manually in SettingsScreens dispose() function.
Suggestions: Most probably, the problem is in Entity.java or EntityService.java but I am not sure.