From 2acc8630fe7952e7d93262159f185211803b2a21 Mon Sep 17 00:00:00 2001 From: Danny Heijl Date: Sat, 12 Aug 2000 12:03:41 +0000 Subject: [PATCH] - The destructor for a connection resource closed the current connection if the connection had been closed before (danny) --- ext/informix/ifx.ec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ext/informix/ifx.ec b/ext/informix/ifx.ec index 7d501e5800..aa487a8aa8 100644 --- a/ext/informix/ifx.ec +++ b/ext/informix/ifx.ec @@ -284,8 +284,10 @@ static void _close_ifx_link(link) IFXLS_FETCH(); EXEC SQL SET CONNECTION :link; - EXEC SQL close database; - EXEC SQL DISCONNECT CURRENT; + if (ifx_check() >= 0) { + EXEC SQL close database; + EXEC SQL DISCONNECT CURRENT; + } efree(link); IFXG(num_links)--; } @@ -299,9 +301,10 @@ EXEC SQL END DECLARE SECTION; IFXLS_FETCH(); EXEC SQL SET CONNECTION :link; - EXEC SQL close database; - EXEC SQL DISCONNECT CURRENT; - + if (ifx_check() >= 0) { + EXEC SQL close database; + EXEC SQL DISCONNECT CURRENT; + } free(link); IFXG(num_persistent)--; IFXG(num_links)--; -- 2.40.0