summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-06-21 12:20:01 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-06-22 20:09:36 +0200
commitafe416c4e156247c864a7140c59f825f0914f1b8 (patch)
tree03a76f145d27ca865cc960ab445c3d6a9e50c070 /src/plugins/sqldrivers
parent0e1da78ad36a0639275b7a0ac8a046f46577452d (diff)
Move tidy-up of private to its own destructor
QOCIResult::~QOCIResult() was doing part of the tidy-up for QOCIResultPrivate, whose own destructor took care of the rest. So move that part to the private, where it makes more sense. Also correct an error message in part of the private's existing tidy-up and eliminate a needless local variable. Change-Id: I09a51c72afd7a30bcee7f6127c59d703650f1c41 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers')
-rw-r--r--src/plugins/sqldrivers/oci/qsql_oci.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp
index a3be29cb38..b8743ea04b 100644
--- a/src/plugins/sqldrivers/oci/qsql_oci.cpp
+++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp
@@ -1862,9 +1862,11 @@ QOCIResultPrivate::~QOCIResultPrivate()
{
delete cols;
- int r = OCIHandleFree(err, OCI_HTYPE_ERROR);
- if (r != 0)
+ if (sql && OCIHandleFree(sql, OCI_HTYPE_STMT) != OCI_SUCCESS)
qWarning("~QOCIResult: unable to free statement handle");
+
+ if (OCIHandleFree(err, OCI_HTYPE_ERROR) != OCI_SUCCESS)
+ qWarning("~QOCIResult: unable to free error report handle");
}
@@ -1877,12 +1879,6 @@ QOCIResult::QOCIResult(const QOCIDriver *db)
QOCIResult::~QOCIResult()
{
- Q_D(QOCIResult);
- if (d->sql) {
- int r = OCIHandleFree(d->sql, OCI_HTYPE_STMT);
- if (r != 0)
- qWarning("~QOCIResult: unable to free statement handle");
- }
}
QVariant QOCIResult::handle() const