![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Pointer going wild and magically back to normal again (sort of)2 code snippets, issue stated below.
CPP / C++ / C Code:
CPP / C++ / C Code:
Ok, so I am watching map in constructor up top. When I run debug, I get the following: Break #1: Map is ok, all values normal Break #2 Map is total garbage values, all bad pointers, unknown stuff, a bunch of question marks etc... Break #3 Still garbage like #2. Break #3 again (this gets called twice at the start) All the values are ok again. Normal I might not care since it eventually returns to normal, however after break #1 I need to pass that pointer to another window as shown in the code, and when that window is created it is seeing those garbage values. This behavior seems totaly wild to me, anyone care to make a guess, or know of a good way to hunt this down ? I tried "stepping" in but I edned up going through about 10 library files where I had no clue what was going on. The only line of code between the watch telling me map is good and then telling me map is bad, is this: pLog = new LogDlg(); But this class has absolutely nothing to do with the map data / classes / whatever. No relation of any kind |
|
#2
|
|||
|
|||
Re: Pointer going wild and magically back to normal again (sort of)Is it possible that map has not been allocated yet? Maybe before you called pLog = new Log(), map was reading values that were left over from the last time you ran the program and when you create the new log, it overwrites that memory location.
That might be something to look at. I don't know. Maybe the code where map gets allocated. |
|
#3
|
|||
|
|||
Re: Pointer going wild and magically back to normal again (sort of)Sorry, I guess it was working good afterall. I found a bug in another function and now its all working fine.
Its weird how the "watch", and the "locals" in VS2005 were giving me such weird results though, maybe I just don't understand the VS debugging system well enough. Anyway, thanks fakepoo |
Recent GIDBlog
Prepping for deployment by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The