Revision: 23395
Author:   [email protected]
Date:     Tue Aug 26 11:00:57 2014 UTC
Log:      Fix memory leak. Make "V8 Linux - memcheck" build bot happy.

Flags::SetFlagsFromCommandLine allocates memory to hold copies of string
arguments when calling Flag::set_string_value(..., true) and presently
noone deallocates this. Resetting the flags will clear this memory.
Since Flags can be used throughout the entire V8 lifetime,
Dispose/Teardown seems like the right location to free this
memory.

This is rarely a problem in practice, but the memcheck buildbot (rightly)
complains.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/505103003
https://code.google.com/p/v8/source/detail?r=23395

Modified:
 /branches/bleeding_edge/src/v8.cc

=======================================
--- /branches/bleeding_edge/src/v8.cc   Mon Aug 11 14:22:24 2014 UTC
+++ /branches/bleeding_edge/src/v8.cc   Tue Aug 26 11:00:57 2014 UTC
@@ -54,6 +54,7 @@
   Isolate::GlobalTearDown();

   Sampler::TearDown();
+  FlagList::ResetAllFlags();  // Frees memory held by string arguments.
 }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to