Changeset 13 for trunk/llmozlib2

Show
Ignore:
Timestamp:
04/29/08 18:19:43 (2 years ago)
Author:
zen.linden
Message:

Memory management cleanup patch for mozilla on OSX and correction of README file for OSX

Code reviewed by Callum

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/llmozlib2/README-mac.txt

    r11 r13  
    2020----------------------------- 
    2121 
    22 If you want to start from scratch, or are updating to a new mozilla release tag, you should first build the mozilla project.  The script ../mozilla-mac-universal-build/checkout_patch_build.sh will check out the mozilla sources from the mozilla cvs server, apply our local patches, and build the whole thing.  Embedded in this script is the CVS tag to check out, which should correspond to one of the official mozilla releases.  If you update to a later version, please commit the change to checkout_patch_build.sh so that others will be able to tell which version is current. 
     22If you want to start from scratch, or are updating to a new mozilla release tag, you should first build the mozilla project.  The script checkout_patch_build.sh in the build_mozilla directory will check out the mozilla sources from the mozilla cvs server, apply our local patches, and build the whole thing.  Embedded in this script is the CVS tag to check out, which should correspond to one of the official mozilla releases.  If you update to a later version, please commit the change to checkout_patch_build.sh so that others will be able to tell which version is current. 
    2323 
    2424Once you have the mozilla library built, run the copy_products_mac.sh script in this directory to pull the necessary bits across.  This will repopulate the architecture-specific portions of the libraries directory here, so you may want to do a preemptive 'svn remove' and commit first.  It will also create mozilla-universal-darwin-original.tgz which contains the necessary runtime bits that need to go into the application bundle. 
  • trunk/llmozlib2/build_mozilla/linden.patch

    r12 r13  
    16701670   // Extract the Offset parameter 
    16711671 
     1672Index: modules/plugin/base/src/nsPluginsDirDarwin.cpp 
     1673=================================================================== 
     1674RCS file: /cvsroot/mozilla/modules/plugin/base/src/nsPluginsDirDarwin.cpp,v 
     1675retrieving revision 1.8.2.1 
     1676diff -r1.8.2.1 nsPluginsDirDarwin.cpp 
     1677--- modules/plugin/base/src/nsPluginsDirDarwin.cpp      2008-04-25 12:57:43.000000000 -0700 
     1678+++ modules/plugin/base/src/nsPluginsDirDarwin.cpp      2008-04-25 13:14:18.000000000 -0700 
     1679@@ -260,7 +260,7 @@ 
     1680 static char* p2cstrdup(StringPtr pstr) 
     1681 { 
     1682     int len = pstr[0]; 
     1683-    char* cstr = new char[len + 1]; 
     1684+    char* cstr = (char*)PR_Malloc((len + 1) * sizeof(char)); 
     1685     if (cstr != NULL) { 
     1686         ::BlockMoveData(pstr + 1, cstr, len); 
     1687         cstr[len] = '\0'; 
     1688@@ -373,10 +373,10 @@ 
     1689  
     1690       // fill-in rest of info struct 
     1691       int variantCount = info.fVariantCount; 
     1692-      info.fMimeTypeArray      = new char*[variantCount]; 
     1693-      info.fExtensionArray     = new char*[variantCount]; 
     1694+      info.fMimeTypeArray      = (char **)PR_Malloc(variantCount * sizeof(char *)); 
     1695+      info.fExtensionArray     = (char **)PR_Malloc(variantCount * sizeof(char *)); 
     1696       if (mi.infoStrings) 
     1697-        info.fMimeDescriptionArray = new char*[variantCount]; 
     1698+        info.fMimeDescriptionArray = (char **)PR_Malloc(variantCount * sizeof(char *)); 
     1699  
     1700       short mimeIndex = 2, descriptionIndex = 2; 
     1701             for (int i = 0; i < variantCount; i++) { 
     1702@@ -403,20 +403,21 @@ 
     1703 { 
     1704     if (info.fPluginInfoSize <= sizeof(nsPluginInfo))  
     1705         { 
     1706-            delete[] info.fName; 
     1707-            delete[] info.fDescription; 
     1708+ 
     1709+            PR_Free(info.fName); 
     1710+            PR_Free(info.fDescription); 
     1711             int variantCount = info.fVariantCount; 
     1712             for (int i = 0; i < variantCount; i++)  
     1713                 { 
     1714-                    delete[] info.fMimeTypeArray[i]; 
     1715-                    delete[] info.fExtensionArray[i]; 
     1716-                    delete[] info.fMimeDescriptionArray[i]; 
     1717+                    PR_Free(info.fMimeTypeArray[i]); 
     1718+                    PR_Free(info.fExtensionArray[i]); 
     1719+                    PR_Free(info.fMimeDescriptionArray[i]); 
     1720                 } 
     1721-            delete[] info.fMimeTypeArray; 
     1722-            delete[] info.fMimeDescriptionArray; 
     1723-            delete[] info.fExtensionArray; 
     1724-            delete[] info.fFileName; 
     1725-            delete[] info.fFullPath; 
     1726+            PR_Free(info.fMimeTypeArray); 
     1727+            PR_Free(info.fMimeDescriptionArray); 
     1728+            PR_Free(info.fExtensionArray); 
     1729+            PR_Free(info.fFileName); 
     1730+            PL_strfree(info.fFullPath); 
     1731         } 
     1732     return NS_OK; 
     1733 }