Lingering input problems after all elements have been removed

After entering the game from my main menu, I remove all elements from the gui screen and remove the control from the GUI Node, then set the Screen instance to null. However, when I press space, I still trigger the last-pressed button in my GUI, which crashes the game seeing as it no longer exists. Is there some deinitialization I’m missing here?

Did you go to the exit screen in your screen controller?

Could you be more specific? I don’t see anything about an exit screen anywhere in the documentation or in the Screen class. My assumption is that there is still an InputListener registered when the control is removed, and that input listener is calling to the Screen instance, which no longer exists.

@bloodwalker I’m not using Nifty GUI…hence why this is posted in the TonegodGUI forum section.

Have you checked that the all listeners are cleared?

It does not seem to be a custom listener problem. I have the same problem. And the problem only occurs, if I click the tonegod button to exit the UI. If I leave the ui by a self written listener to the ENTER or ESC key, the problem does not occur.

ONLY, and really only, if I CLICK the button of the tonegod ui.

Ha …


Whereever and whoever this listeners are added. This is not a listener from me that must be removed.