List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:February 19 2011 12:13am
Subject:Re: EXC_BAD_ACCESS exception from storein(container) in MYSQL++ on MAC OS 10
View as plain text  
On Feb 17, 2011, at 11:55 AM, Alan Shank wrote:

> My code, which works fine in Linux (Ubuntu 10.10)

I suspect that if you run it under Valgrind on Linux it will catch a bug there, too. 
Working isn't the same as being correct. :)

> vector<deepskyStruct>::iterator it; 
> for loop through the vector, creating members of class SessionObject from the data 
> end for 

Move the vector inside the loop, so it gets completely destroyed then rebuilt on each
query.  As your code is structured now, each query after the first is going to *append*
its results to this result set.

Alternately, you can say "resvec.clear()" on each iteration, which may be slightly more
efficient.  (Or might not.  Benchmark to find out, if it matters.)

It's possible that your bug is simply due to running the PC out of memory.
Thread
EXC_BAD_ACCESS exception from storein(container) in MYSQL++ on MAC OS 10Alan Shank17 Feb
  • Re: EXC_BAD_ACCESS exception from storein(container) in MYSQL++ on MAC OS 10Warren Young19 Feb
Re: EXC_BAD_ACCESS exception from storein(container) in MYSQL++ onMAC OS 10Warren Young19 Feb