|
-
February 27th, 2013, 06:05 AM
#4
Re: Odd Dialog creation... when deleting unused line of code
 Originally Posted by pbrama
I ran into a very weird problem and after a lot of trial error, narrowed it down to a single line of code that should NOT be causing this problem...
And the answer to you is memory corruption, plain and simple. That memory could be corrupted by any number of ways, from a buffer overrun, to accessing invalid memory in some way and using it (maybe a variable is uninitialized and you're using this uninitialized variable to perform critical code in your app), etc.
Anytime you move, add, or remove lines of code that are totally benign, and the program now crashes, behaves differently, magically works, all without an explanation, it is due to memory corruption.
When you move/add/change lines, you're also changing the binary executable that is being produced. Any memory corruption such as buffer overrun may not show the effects due to the area of the overrun being moved to a "safe" area in the changed executable, where an overrun cannot be detected.
Of course, I could just leave this line in place and ignore it...
No.
Remove that line, duplicate the problem, and fix the problem. The last thing you want to do is move the corruption bug to another area in the program, where you now do not know where it can be lurking.
I've never had an issue with REMOVING a variable declaration unless that variable is used, which it is not... that's what makes this so bizarre.
There is really nothing bizarre about it. That's what happens when you corrupt memory.
Any suggestions or ideas that may point me in the right direction for fixing this issue, would be greatly appreciated....
Again, you shouldn't change any code whatsoever. Keep the non-working code, and fix the problem. The dialog doesn't show, then great -- you see the problem, you have the source code, so now it's time to debug what is wrong.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; February 27th, 2013 at 06:10 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|