Date: Thursday, March 30, 2006 @ 23:36:33
Author: marc
Path: /cvsroot/carob/odbsequoia/src
Modified: connect.cpp (1.22 -> 1.23)
Now setting *OutputHandle right away, so caller can make the
difference between before vs after successful ctor and clean up.
Using a reference instead of a pointer.
-------------+
connect.cpp | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
Index: odbsequoia/src/connect.cpp
diff -u odbsequoia/src/connect.cpp:1.22 odbsequoia/src/connect.cpp:1.23
--- odbsequoia/src/connect.cpp:1.22 Thu Mar 30 21:23:52 2006
+++ odbsequoia/src/connect.cpp Thu Mar 30 23:36:33 2006
@@ -179,10 +179,11 @@
{
// FIXME: leaking here when the application forgets
// to call SQLFreeHandle(STMT, newstmt)
- ODBCStatement * newstmt = new ODBCStatement(*this);
- newstmt->carob_stmt = carob_conn->createStatement();
- newstmt->state = S1;
- *OutputHandle = newstmt;
+ ODBCStatement & newstmt = * new ODBCStatement(*this);
+ *OutputHandle = & newstmt;
+
+ newstmt.carob_stmt = carob_conn->createStatement();
+ newstmt.state = S1;
return SQL_SUCCESS;
}
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits