summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/file
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/file
parent5337d264f5a2f0db08b0cf2f86c510f83d2b8e43 (diff)
create-/prepareStatement: hold the returned object alive while <weakcontainer>.push_back
Diffstat (limited to 'connectivity/source/drivers/file')
-rw-r--r--connectivity/source/drivers/file/FConnection.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index 09899a561e50..505c6fb0fe84 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FConnection.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: fs $ $Date: 2000-10-06 12:03:08 $
+ * last change: $Author: fs $ $Date: 2000-10-06 14:51:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -261,10 +261,10 @@ Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLExcep
::osl::MutexGuard aGuard( m_aMutex );
if (OConnection_BASE::rBHelper.bDisposed)
throw DisposedException();
- OStatement* pStmt = new OStatement(this);
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return pStmt;
+ Reference< XStatement > xReturn = new OStatement(this);
+ m_aStatements.push_back(WeakReferenceHelper(xReturn));
+ return xReturn;
}
// --------------------------------------------------------------------------------
Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
@@ -275,6 +275,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::
OPreparedStatement* pStmt = new OPreparedStatement(this,m_aTypeInfo);
pStmt->construct(sql);
+ Reference< XPreparedStatement > xHoldAlive = pStmt;
m_aStatements.push_back(WeakReferenceHelper(*pStmt));
return pStmt;
}