I was able to remove this eventually but it was difficult to track down. I had to go through all of the code to see exactly what caused it. It turned out a child window hadn't been closed or removed properly as soon as this was done it went away forever.
So the advise that would have helped in my case would be don't concentrate on the window you are closing as being the issue. See any child windows that my still be hanging around.
Try duplicating your project and removing large parts of your code and peel back the onion until closing the same window results in no black screen then you've got your culprit. Happy hunting!