diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-16 11:45:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-16 11:45:54 +0200 |
commit | c803163e7c8af93828809cd98a12c14d36ee96c4 (patch) | |
tree | cbbb94fa1f6fdb66f3ffb638b9af92ccc2e3f22d /odb | |
parent | bad675ea0e17b6eb18d75ddc403b81ff5f76ad25 (diff) |
Add pointer guard for naked pointer
Diffstat (limited to 'odb')
-rw-r--r-- | odb/mysql/result.hxx | 4 | ||||
-rw-r--r-- | odb/mysql/result.txx | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/odb/mysql/result.hxx b/odb/mysql/result.hxx index 0f01ff9..6153f59 100644 --- a/odb/mysql/result.hxx +++ b/odb/mysql/result.hxx @@ -23,7 +23,7 @@ namespace odb public: typedef object_traits<T> traits; typedef typename traits::pointer_type pointer_type; - typedef typename traits::pointer_ops pointer_ops; + typedef typename traits::pointer_traits pointer_traits; virtual ~result_impl (); @@ -40,6 +40,8 @@ namespace odb void next (); + using odb::result_impl<T>::current; + private: shared_ptr<query_statement> statement_; object_statements<T>& statements_; diff --git a/odb/mysql/result.txx b/odb/mysql/result.txx index debb725..d81f058 100644 --- a/odb/mysql/result.txx +++ b/odb/mysql/result.txx @@ -28,9 +28,9 @@ namespace odb { if (!this->end_) { - this->current_ = traits::create (); - traits::init (pointer_ops::get_ref (this->current_), - statements_.image ()); + pointer_type p (traits::create ()); + current (p); + traits::init (pointer_traits::get_ref (p), statements_.image ()); } } @@ -46,7 +46,7 @@ namespace odb void result_impl<T>:: next () { - this->current_ = pointer_type (); + this->current (pointer_type ()); query_statement::result r (statement_->fetch ()); switch (r) |