Date: Tuesday, December 6, 2005 @ 17:42:07
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/Statement.hpp (1.11 -> 1.12) src/Statement.cpp (1.13 ->
1.14)
(part of previous commit)
Added DriverResultSet as friend class to allow update of ResultSet pointer when
it (the result set) is destroyed
Added missing delete of resultPtr in executeQuery()
-----------------------+
include/Statement.hpp | 5 +++++
src/Statement.cpp | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
Index: carob/include/Statement.hpp
diff -u carob/include/Statement.hpp:1.11 carob/include/Statement.hpp:1.12
--- carob/include/Statement.hpp:1.11 Fri Dec 2 15:53:07 2005
+++ carob/include/Statement.hpp Tue Dec 6 17:42:07 2005
@@ -68,6 +68,11 @@
* because only Connection can create statements
*/
friend class Connection;
+/**
+ * DriverResultSet must inform us when it is destroyed. Let's allow it to
+ * reset the <code>resultPtr</code>
+ */
+friend class DriverResultSet;
public:
//No constructor, statements must be created by connections
Index: carob/src/Statement.cpp
diff -u carob/src/Statement.cpp:1.13 carob/src/Statement.cpp:1.14
--- carob/src/Statement.cpp:1.13 Fri Dec 2 15:53:07 2005
+++ carob/src/Statement.cpp Tue Dec 6 17:42:07 2005
@@ -43,7 +43,10 @@
Statement::~Statement()
{
if (resultPtr != NULL)
+ {
delete resultPtr;
+ resultPtr = NULL;
+ }
}
void Statement::setReadRequestParameters(RequestWithResultSetParameters&
request)
@@ -88,6 +91,7 @@
if (resultPtr != NULL)
{ // Discard the previous result
resultPtr->close();
+ delete resultPtr;
resultPtr = NULL;
}
@@ -147,7 +151,6 @@
* object; <code>false</code> if it is an update count or there are
* no more results
* @exception SQLException if a database access error occurs
- * @since JDK 1.4
* @see #execute(String)
*/
bool Statement::getMoreResults(int current) throw (DriverException,
SQLException,
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits