mirror of
https://github.com/php/php-src.git
synced 2026-03-26 01:02:25 +01:00
When a connection is closed, we also need to remove the hash entry from the regular_list, as it now points to freed memory. To do this store a reverse mapping from the connection to the hash string. It would be nicer to introduce a wrapping structure for the pgsql link resource that could store the hash (and notices), but that would require large changes to the extension, so I'm going for a more minimal fix here.
20 lines
323 B
PHP
20 lines
323 B
PHP
--TEST--
|
|
Reopen connection after it was closed
|
|
--SKIPIF--
|
|
<?php include("skipif.inc"); ?>
|
|
--FILE--
|
|
<?php
|
|
include('config.inc');
|
|
|
|
/* Run me under valgrind */
|
|
$db1 = pg_connect($conn_str);
|
|
unset($db1);
|
|
var_dump(pg_close());
|
|
$db2 = pg_connect($conn_str);
|
|
unset($db2);
|
|
var_dump(pg_close());
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(true)
|