Fix for exception thrown when cancelling generating source from code
Merge branch 'sourcecodegenerator'