summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/dbase/DConnection.cxx
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2000-10-06 13:51:31 +0000
committerFrank Schönheit <fs@openoffice.org>2000-10-06 13:51:31 +0000
commita544cbc2e0609ae6a8ce54c347fb8404e88009e9 (patch)
tree3386edc3c7cead8a777e7378afced7544db8128d /connectivity/source/drivers/dbase/DConnection.cxx
parent5337d264f5a2f0db08b0cf2f86c510f83d2b8e43 (diff)
create-/prepareStatement: hold the returned object alive while <weakcontainer>.push_back
Diffstat (limited to 'connectivity/source/drivers/dbase/DConnection.cxx')
-rw-r--r--connectivity/source/drivers/dbase/DConnection.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/connectivity/source/drivers/dbase/DConnection.cxx b/connectivity/source/drivers/dbase/DConnection.cxx
index 0f7cc2a27e0d..ecf8b8efb4b3 100644
--- a/connectivity/source/drivers/dbase/DConnection.cxx
+++ b/connectivity/source/drivers/dbase/DConnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: DConnection.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2000-09-29 15:28:55 $
+ * last change: $Author: fs $ $Date: 2000-10-06 14:51:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -146,10 +146,10 @@ Reference< XStatement > SAL_CALL ODbaseConnection::createStatement( ) throw(SQL
::osl::MutexGuard aGuard( m_aMutex );
if (OConnection_BASE::rBHelper.bDisposed)
throw DisposedException();
- ODbaseStatement* pStmt = new ODbaseStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return pStmt;
+ Reference< XStatement > xReturn = new ODbaseStatement(this);
+ m_aStatements.push_back(WeakReferenceHelper(xReturn));
+ return xReturn;
}
// --------------------------------------------------------------------------------
Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
@@ -160,6 +160,7 @@ Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareStatement( con
ODbasePreparedStatement* pStmt = new ODbasePreparedStatement(this,m_aTypeInfo);
pStmt->construct(sql);
+ Reference< XPreparedStatement > xHoldAlive = pStmt;
m_aStatements.push_back(WeakReferenceHelper(*pStmt));
return pStmt;
}