Delete code generators after using them.
authorDavid Reiss <dreiss@apache.org>
Thu, 27 Mar 2008 21:39:49 +0000 (21:39 +0000)
committerDavid Reiss <dreiss@apache.org>
Thu, 27 Mar 2008 21:39:49 +0000 (21:39 +0000)
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.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665586 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/main.cc

index 80da53a..e44c9b3 100644 (file)
@@ -962,6 +962,7 @@ void generate(t_program* program, const vector<string>& generator_strings) {
       } else {
         pverbose("Generating \"%s\"\n", iter->c_str());
         generator->generate_program();
+        delete generator;
       }
     }