diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-03-07 10:21:09 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-03-07 10:21:09 +0200 |
commit | d2fc34834f0b7660374f78d4409e24a165950c2c (patch) | |
tree | 28fd2e0c9b257a5e39d9e29a176472304f51eed1 /odb/oracle/statement.hxx | |
parent | 729992078ad2840791d74a7a61113bce0f7c29ff (diff) |
Use RAII to free select statement results
Diffstat (limited to 'odb/oracle/statement.hxx')
-rw-r--r-- | odb/oracle/statement.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/odb/oracle/statement.hxx b/odb/oracle/statement.hxx index f26aa42..ed8f298 100644 --- a/odb/oracle/statement.hxx +++ b/odb/oracle/statement.hxx @@ -192,6 +192,19 @@ namespace odb bool done_; }; + struct LIBODB_ORACLE_EXPORT auto_result + { + explicit auto_result (select_statement& s): s_ (s) {} + ~auto_result () {s_.free_result ();} + + private: + auto_result (const auto_result&); + auto_result& operator= (const auto_result&); + + private: + select_statement& s_; + }; + class LIBODB_ORACLE_EXPORT insert_statement: public statement { public: |