aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-08-16 11:45:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-08-16 11:45:54 +0200
commitc803163e7c8af93828809cd98a12c14d36ee96c4 (patch)
treecbbb94fa1f6fdb66f3ffb638b9af92ccc2e3f22d
parentbad675ea0e17b6eb18d75ddc403b81ff5f76ad25 (diff)
Add pointer guard for naked pointer
-rw-r--r--odb/mysql/result.hxx4
-rw-r--r--odb/mysql/result.txx8
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)