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.
Duplicate from: UQdeco2800/2021-ext-studio-2#271
Description
Entitycomponents for a particularScreenare registered to theEntityService. When theEntityServiceinitialized for that particular screen is disposed, thedispose()functions for each component attached to thatEntityare not called. Manually callingentity.dispose()works, butServiceLocator.getEntityService.dispose()does not work.How to reproduce
The
dispose()function of theSettingsMenuDisplaycomponent does not get called whenServiceLocator.getEntityService().dispose()is called on theSettingsScreen, although the corresponding entity is registered to the service as we can see in thecreateUI()method. Disposing the entity manually inSettingsScreen'sdispose()function works.Temporary Fix
Dispose the entity manually in
SettingsScreens dispose() function.Suggestions: Most probably, the problem is in
Entity.javaorEntityService.javabut I am not sure.