- Joined
- Jun 6, 2012
- Messages
- 317
- Reaction score
- 122
- Points
- 43
- Location
- Sydney, Australia, Earth, Sol
- Website
- www.orbithangar.com
Hi All,
I have encountered a very strange proplem, twice now, in totally different projects. I have no idea what this is, if it is something wrong with my code, or bug of somesort. The only thing I can do is describe it and see if anyone might know what is causing this.
Say I have a header file, with a VESSEL class and some variables and methods. I have all those declared in my header. I have only ever encountered this while loading a simulation state (and calling clbkLoadStateEx): one of those variables whill just seem to load the value from it's neighbor (down one line). I am not sure if this is bad coding on my part, something to do with the static .lib that I have made and linked with, or some other issue.
EXAMPLE:
In a header file I may have this:
Seemingly for no reason, when the values of these members are loaded via clbkLoadStateEx, I might have 'ison' load the value for loaded[1]. When I encounter this issue, it will always be relevant to that member's position in the header file. The ONLY solution I have been able to find, is to place (in this example case) a dummy member, for example int i; between 'bool loaded[2];' and 'bool ison;' in the header file. This corrects the issue, as it almost seems to be a problem with that particular line. I have searched everywhere for an explination for this but have never seen anything like it. Could this be the result of a memory leak? I even performed diagnostics on my system's memory in case of a bad address, but no issues. It is only an issue when loading via clbkLoadStateEx.
I have encountered this twice now, in totally seperate projects.
Sorry if I have not explained myself well, but this is really hard to explain... it makes no sense to me at all...
Thanks all.
I have encountered a very strange proplem, twice now, in totally different projects. I have no idea what this is, if it is something wrong with my code, or bug of somesort. The only thing I can do is describe it and see if anyone might know what is causing this.
Say I have a header file, with a VESSEL class and some variables and methods. I have all those declared in my header. I have only ever encountered this while loading a simulation state (and calling clbkLoadStateEx): one of those variables whill just seem to load the value from it's neighbor (down one line). I am not sure if this is bad coding on my part, something to do with the static .lib that I have made and linked with, or some other issue.
EXAMPLE:
In a header file I may have this:
C++:
double boxes[12];
int X, Y;
void DoSomething ();
bool loaded[2];
bool ison;
int lvl;
Seemingly for no reason, when the values of these members are loaded via clbkLoadStateEx, I might have 'ison' load the value for loaded[1]. When I encounter this issue, it will always be relevant to that member's position in the header file. The ONLY solution I have been able to find, is to place (in this example case) a dummy member, for example int i; between 'bool loaded[2];' and 'bool ison;' in the header file. This corrects the issue, as it almost seems to be a problem with that particular line. I have searched everywhere for an explination for this but have never seen anything like it. Could this be the result of a memory leak? I even performed diagnostics on my system's memory in case of a bad address, but no issues. It is only an issue when loading via clbkLoadStateEx.
I have encountered this twice now, in totally seperate projects.
Sorry if I have not explained myself well, but this is really hard to explain... it makes no sense to me at all...
Thanks all.