You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
ThatTechedGuy
changed the title
EntityService disposals dont work
[Bug] EntityService dispose() doesn't work
Sep 20, 2021
Duplicate from: UQdeco2800/2021-ext-studio-2#271 (comment)
In EntityService.java, we can see that when dispose() is called, two entities exist. But SettingsMenuDisplay is not traversed.
I don't know why this phenomenon occurs, below is the code to traverse the entities.
This situation exists in other screens, even in the original game engine.
I didn't figure out why this phenomenon happened, dispose() in EntityService seems to only do part of the work. Maybe there are other reasons for this.
What I can confirm is that the dispose of CameraConponent does not eliminate SettingsMenuDisplay entity.
And SettingsMenuDisplay has never called the dispose method in the eneity.java file.
Duplicate from: UQdeco2800/2021-ext-studio-2#271
Description
Entity
components for a particularScreen
are registered to theEntityService
. When theEntityService
initialized for that particular screen is disposed, thedispose()
functions for each component attached to thatEntity
are not called. Manually callingentity.dispose()
works, butServiceLocator.getEntityService.dispose()
does not work.How to reproduce
The
dispose()
function of theSettingsMenuDisplay
component 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
SettingsScreen
s dispose() function.Suggestions: Most probably, the problem is in
Entity.java
orEntityService.java
but I am not sure.The text was updated successfully, but these errors were encountered: