When a mod is disabled or removed from mod directory, its GUI can be removed correctly.
However, when a mod becomes incompatible with Factorio, e.g. game is upgraded from 0.13 to 0.14, the GUI created by the mod cannot be automatically removed.
Steps to reproduce:
1) Download the following little mod. It creates a button on gui.top of the player. When the button is clicked, a message is printed.
The mod is compatible with Factorio 0.13. 2) Launch Factorio 0.13 and start a game. The button will be shown like this: 3) Save the game and quit Factorio.
4) Update Factorio to 0.14 and launch it.
5) [Optional] Check mod list to make sure the mod is incompatible (font color = red) 6) Load the save in step 3. 7) Because the mod is not loaded, locale is lost. Also, when you click the button, nothing will be done.
PS: I am not sure whether it is a bug or not, since the mod status is still "Enabled". But Rseding told me to submit a bug report, so I am here.
