Fix memory leak and missing #include in StartupDataDecompressor
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 20 Feb 2012 11:01:17 +0000 (11:01 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 20 Feb 2012 11:01:17 +0000 (11:01 +0000)
BUG=v8:1960
TEST=compile with GYPFLAGS=-Dv8_compress_snapshot_data=bz2, then run d8 with valgrind

Review URL: https://chromiumcodereview.appspot.com/9395073

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10751 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/api.cc

index 2f8f1d15da74d63fce23f7a2f9d99c0e320b0da9..67fded8eb0940016c8a994e8ea0de46e98a813ed 100644 (file)
@@ -42,6 +42,9 @@
 #include "global-handles.h"
 #include "heap-profiler.h"
 #include "messages.h"
+#ifdef COMPRESS_STARTUP_DATA_BZ2
+#include "natives.h"
+#endif
 #include "parser.h"
 #include "platform.h"
 #include "profile-generator-inl.h"
@@ -357,6 +360,7 @@ int StartupDataDecompressor::Decompress() {
     compressed_data[i].data = decompressed;
   }
   V8::SetDecompressedStartupData(compressed_data);
+  i::DeleteArray(compressed_data);
   return 0;
 }