Bug fix memory leak informix
| From: | Wim Vinckier | Date: | Tue, 06 Aug 2002 12:11:51 +0000 |
| Subject: | Bug fix memory leak informix | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-8191@lists.php.net to get a copy of this message | ||
Hi,
When I did a lot of INSERTS, UPDATES and DELETE, I got a pretty serious
memory leak when I used the pear module. Since I had the same experience
with the informix module of PHP, I knew there was a un-freeed result
somewhere. I corrected in ifx.php this way:
Index: ifx.php
===================================================================
RCS file: /repository/pear/DB/DB/ifx.php,v
retrieving revision 1.4
diff -u -u -r1.4 ifx.php
--- ifx.php 26 May 2002 14:41:27 -0000 1.4
+++ ifx.php 6 Aug 2002 12:08:01 -0000
@@ -133,6 +133,9 @@
if (preg_match('/(SELECT)/i', $query)) {
return $result;
}
+ // Result has to be freeed even with a insert or update
+ ifx_free_result ($result);
+
return DB_OK;
}
@@ -320,4 +323,4 @@
// }}}
}
-?>
\ No newline at end of file
+?>
Greeting,
Wim Vinckier
------------------------------------------------------------------------
Wim VINCKIER +32 473 96 06 24
Wasstraat 38 WimPunk@tisnix.be
B-9000 Gent ICQ 100545109
------------------------------------------------------------------------
I dont suffer from insanity, i enjoy every minute of it!