When EN_Destructor is called it searches through the connection array
authorDave Page <dpage@pgadmin.org>
Tue, 25 Oct 2005 07:38:54 +0000 (07:38 +0000)
committerDave Page <dpage@pgadmin.org>
Tue, 25 Oct 2005 07:38:54 +0000 (07:38 +0000)
commit679c32509c243f1f64f7976dc6b3a2a85a93d45b
tree0509a971d0237a07a5afc1d8a292f87bea6c8478
parentbc8e95b08f8201251ed91bcf00e0dafaa3b1b445
When EN_Destructor is called it searches through the connection array
and destroys any connections which belong that environment. Unfortunately
it doesn't NULL out the connection array entry afterwards so a future
call to EN_Destructor can wind up trying to destroy that connection
again if another environment has been allocated at the same address.

Also, shouldn't EN_Destructor hold the CONNS critical section while it
is playing with the connection array?

The attached patch fixes both of these issues and seems to have fixed
the crashes I was observing.
[Tom Hughes]
environ.c