[odb-users] Segfault after adding relations

kontakt at msnoch.pl kontakt at msnoch.pl
Tue Sep 27 17:10:08 EDT 2011


 Hi friends,

 I'm wondering why i have segmentation fault in code like this:

 transaction t(db->begin());
 result start(db->query<Stop>(query::name == p_from || query::street == 
 p_from));

 for(result::iterator i(start.begin()); i!= start.end(); ++i)
 {
   cout << "Found " << i->getStreet().toStdString() << endl;
 }

 t.commit();

 everything was fine until I started using relations. Stop have 
 shared_ptr to other class, and other class have
 weak_ptr to Stop. In fact, now also everything works (8 rows are found) 
 if I don't use i->getStreet(), but it
 is unacceptable of course ;)

 I hope that you can help me

 Best regards
 Michal Snoch



More information about the odb-users mailing list