I found the same problem, and ended up with a similar solution. I created an unload method on the my controller class and set inst, app, commands and commandLog to null;.