Permalink
Browse files

revert changes to leak statements and connections

--HG--
extra : convert_revision : ec8d9e027241013af1f414b3a40e242ca90a667d
  • Loading branch information...
waterson committed Feb 17, 2009
1 parent 6719e10 commit 3b128ab713be4256126ab4f8af6e5c7498ae446b
Showing with 2 additions and 10 deletions.
  1. +2 −10 Database/HDBC/MySQL/Connection.hsc
@@ -120,11 +120,7 @@ connectMySQL info = do
-- So we'll turn it off here and start our first transaction.
mysql_autocommit mysql_ 0
- -- XXX force a leak here. I have yet to fathom why the
- -- references below to mysql__ don't keep the foreignPtr
- -- alive.
- --mysql__ <- newForeignPtr mysql_close mysql_
- mysql__ <- newForeignPtr_ mysql_
+ mysql__ <- newForeignPtr mysql_close mysql_
doStartTransaction mysql__
return $ Connection
@@ -249,11 +245,7 @@ newStatement mysql__ query = withForeignPtr mysql__ $ \mysql_ -> do
-- If an error occurs below, we'll lose the reference to the foreign
-- pointer and run the finalizer.
-
- -- XXX force a leak here. I have yet to fathom why the references
- -- below to stmt__ don't keep the foreignPtr alive.
- --stmt__ <- newForeignPtr mysql_stmt_close stmt_
- stmt__ <- newForeignPtr_ stmt_
+ stmt__ <- newForeignPtr mysql_stmt_close stmt_
withCStringLen query $ \(query_, len) -> do
rv <- mysql_stmt_prepare stmt_ query_ (fromIntegral len)

0 comments on commit 3b128ab

Please sign in to comment.