Free the component-location arrays at shutdown.
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 25 Jun 2010 17:27:10 -0400
changeset 47061 116abfbc71e5c7c63a8ec4eae7dbdbaf63a76d5f
parent 47058 d8274b38a72a5e6d6ca2be69e72615ffeb9f05ab
child 47062 f631240d8a9d1eda1f942fc17c0f16dbdb2632db
push idunknown
push userunknown
push dateunknown
milestone1.9.3a6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Free the component-location arrays at shutdown.
tools/rb/make-tree.pl
xpcom/components/nsComponentManager.cpp
--- a/tools/rb/make-tree.pl
+++ b/tools/rb/make-tree.pl
@@ -107,16 +107,18 @@ my $callGraphRoot;
 # callsite is. It is used to prune away callsites that are detected to
 # be balanced; that is, that have matching AddRef/Release() pairs.
 
 my %imbalance;
 $imbalance{'.root'} = 'n/a';
 
 # The main read loop.
 
+$/ = '\r\n';
+
 sub read_data($$$) {
      my ($INFILE, $plus, $minus) = @_;
 
      LINE: while (<$INFILE>) {
           next LINE if (! /^</);
           my @fields = split(/ /, $_);
      
           my $class = shift(@fields);
@@ -184,17 +186,16 @@ sub read_data($$$) {
               } else {
                   die "Bad operation $op";
               }
      
               $caller = $site;
           }
      }
 }
-
 read_data(*STDIN, "AddRef", "Release");
 
 if ($::opt_comptrs) {
      warn "Subtracting comptr log ". $::opt_comptrs . "\n";
      open(COMPTRS, "<".$::opt_comptrs)
          || die "unable to open $::opt_comptrs";
 
      # read backwards to subtract
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -829,16 +829,19 @@ nsresult nsComponentManagerImpl::Shutdow
     mContractIDs.Clear();
     mFactories.Clear(); // XXX release the objects, don't just clear
     mLoaderMap.Clear();
     mKnownFileModules.Clear();
     mKnownStaticModules.Clear();
 
     mLoaderData.Clear();
 
+    delete sStaticModules;
+    delete sModuleLocations;
+
     // Unload libraries
     mNativeModuleLoader.UnloadLibraries();
 
     // delete arena for strings and small objects
     PL_FinishArenaPool(&mArena);
 
     mStatus = SHUTDOWN_COMPLETE;