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.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.