Delete code generators after using them. This has been leaking memory in the compiler, but it has also been preventing the dynamic generators destructors from being called. This can prevent a stream from being flushed properly.