]> granicus.if.org Git - php/commitdiff
defer loading of the native code
authorSam Ruby <rubys@php.net>
Tue, 27 Jun 2000 10:37:40 +0000 (10:37 +0000)
committerSam Ruby <rubys@php.net>
Tue, 27 Jun 2000 10:37:40 +0000 (10:37 +0000)
sapi/servlet/servlet.java

index b69d482e27008079476336997317064514d6a722..c085488309bbde25c444378ca456aec8adcd3967 100644 (file)
@@ -42,7 +42,6 @@ public class servlet extends HttpServlet {
     /*                          native methods                        */ 
     /******************************************************************/
 
-    static { reflect.loadLibrary("servlet"); }
     public native void startup();
     public native long define(String name);
     public native void send(String requestMethod, String queryString,
@@ -124,7 +123,12 @@ public class servlet extends HttpServlet {
 
     public void init(ServletConfig config) throws ServletException {
       super.init(config);
-      if (0 == startup_count++) startup();
+
+      // first time in, initialize native code
+      if (0 == startup_count++) {
+        reflect.loadLibrary("servlet");
+        startup();
+      }
 
       // try to find the addHeader method (added in the servlet API 2.2)
       // otherwise settle for the setHeader method