Do not sv_free session handle if close handler is called
[simpleserver-moved-to-github.git] / SimpleServer.xs
index e324009..34cbb9a 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: SimpleServer.xs,v 1.31 2004-06-06 09:07:18 adam Exp $ 
+ * $Id: SimpleServer.xs,v 1.33 2004-06-07 17:00:55 adam Exp $ 
  * ----------------------------------------------------------------------
  * 
  * Copyright (c) 2000-2004, Index Data.
  * ----------------------------------------------------------------------
  * 
  * Copyright (c) 2000-2004, Index Data.
@@ -103,7 +103,7 @@ CV * simpleserver_sv2cv(SV *handler) {
 }
 
 /* debugging routine to check for destruction of Perl interpreters */
 }
 
 /* debugging routine to check for destruction of Perl interpreters */
-#if 1
+#ifdef USE_ITHREADS
 void tst_clones(void)
 {
     int i; 
 void tst_clones(void)
 {
     int i; 
@@ -1301,7 +1301,8 @@ void bend_close(void *handle)
 
                sv_free((SV*) href);
        }
 
                sv_free((SV*) href);
        }
-       sv_free(zhandle->handle);
+       else
+               sv_free(zhandle->handle);
        PUTBACK;
        FREETMPS;
        LEAVE;
        PUTBACK;
        FREETMPS;
        LEAVE;