You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2008/01/21 14:25:15 UTC

svn commit: r613881 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c

Author: hindessm
Date: Mon Jan 21 05:25:14 2008
New Revision: 613881

URL: http://svn.apache.org/viewvc?rev=613881&view=rev
Log:
Probably best not to free the current bootstrap classpath while the VM
is still using it.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c?rev=613881&r1=613880&r2=613881&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c Mon Jan 21 05:25:14 2008
@@ -291,6 +291,7 @@
     char *bootDirectory;
     char *propsFile;
     char *bootstrapClassPath = NULL;
+    char *currentBootstrapClassPath = NULL;
     vmiError rcGetProperty;
     jint returnCode;
     key_value_pair * props = NULL;
@@ -347,6 +348,9 @@
             goto cleanup;
         }
 
+        /* Save current bootstrapClassPath so we don't free it */
+        currentBootstrapClassPath = bootstrapClassPath;
+
         qsort(props, number, sizeof(key_value_pair), props_compare);
 
         for (;i < number; i++) 
@@ -365,7 +369,9 @@
                     bootstrapClassPath = str_concat (PORTLIB, 
                         bootstrapClassPath, cpSeparator,
                         bootDirectory, props[i].value, NULL);
-                    hymem_free_memory (oldPath);
+                    if (oldPath != currentBootstrapClassPath) {
+                        hymem_free_memory (oldPath);
+                    }
                 }
 
                 if (!bootstrapClassPath)