File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ mkConn auto_transaction args conn = withConn conn $
79
79
serverver <- pqserverVersion cconn
80
80
let clientver = # {const_str PG_VERSION }
81
81
let rconn = Impl. Connection {
82
- Impl. disconnect = fdisconnect children,
82
+ Impl. disconnect = fdisconnect conn children,
83
83
Impl. begin = if auto_transaction
84
84
then return ()
85
85
else begin_transaction conn children,
@@ -170,8 +170,11 @@ fdescribeSchemaTable o cl maybeSchema table =
170
170
desccol x =
171
171
error $ " Got unexpected result from pg_attribute: " ++ show x
172
172
173
- fdisconnect :: ChildList -> IO ()
174
- fdisconnect = closeAllChildren
173
+ fdisconnect :: Conn -> ChildList -> IO ()
174
+ fdisconnect (lock, fptr) childList = do
175
+ closeAllChildren childList
176
+ modifyMVar_ lock $ \ _ ->
177
+ finalizeForeignPtr fptr
175
178
176
179
foreign import ccall safe " libpq-fe.h PQconnectdb"
177
180
pqconnectdb :: CString -> IO (Ptr CConn )
You can’t perform that action at this time.
0 commit comments