harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r822182 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c
Date Tue, 06 Oct 2009 10:01:15 GMT
Author: hindessm
Date: Tue Oct  6 10:01:14 2009
New Revision: 822182

URL: http://svn.apache.org/viewvc?rev=822182&view=rev
Log:
Avoid growing stack frame by deleting local references.

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

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c?rev=822182&r1=822181&r2=822182&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c Tue Oct
 6 10:01:14 2009
@@ -138,6 +138,7 @@
             {
               return NULL;
             }
+          (*env)->DeleteLocalRef(env, bytearray);
         }
 
       if (networkInterfaceArray.elements[j].displayName != NULL)
@@ -159,6 +160,7 @@
             {
               return NULL;
             }
+          (*env)->DeleteLocalRef(env, bytearray);
         }
 
       /* generate the object with the inet addresses for the interface       */
@@ -194,6 +196,9 @@
                            displayName, addresses,
                            networkInterfaceArray.elements[j].index);
 
+      (*env)->DeleteLocalRef(env, name);
+      (*env)->DeleteLocalRef(env, addresses);
+
       if (j == 0)
         {
           networkInterfaces =
@@ -205,6 +210,9 @@
           (*env)->SetObjectArrayElement (env, networkInterfaces, j,
                                          currentInterface);
         }
+          
+      (*env)->DeleteLocalRef(env, currentInterface);
+
     }
 
   /* free the memory for the interfaces struct and return the new NetworkInterface List */



Mime
View raw message