Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Force-leak statements and connections until we can figure out Foreign…

…Ptrs.

--HG--
extra : convert_revision : 458d07664a4a8989f4c64e4945383fe0a9d6ea5b
  • Loading branch information...
commit b6fda712e31ce8be90f2f9153f319f72cd5dc569 1 parent 3262b8e
@waterson waterson authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 Database/HDBC/MySQL/Connection.hsc
View
12 Database/HDBC/MySQL/Connection.hsc
@@ -120,7 +120,11 @@ connectMySQL info = do
-- So we'll turn it off here and start our first transaction.
mysql_autocommit mysql_ 0
- mysql__ <- newForeignPtr mysql_close mysql_
+ -- 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_
doStartTransaction mysql__
return $ Connection
@@ -245,7 +249,11 @@ 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.
- stmt__ <- newForeignPtr mysql_stmt_close stmt_
+
+ -- 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_
withCStringLen query $ \(query_, len) -> do
rv <- mysql_stmt_prepare stmt_ query_ (fromIntegral len)
Please sign in to comment.
Something went wrong with that request. Please try again.