Different execution between Release and Debug version 
Author Message
 Different execution between Release and Debug version

Hi,

I'm writing an application in Visual C++ which uses many
CPtrList classes with a hundreds of nodes and I'm getting
different results when using the Release or Debug version.

My program crashes in the Release version when I try to
delete all CPtrList classes but not in the Debug one. I
use a loop (while (! list.IsEmpty()) ) and the RemoveHead()
method for removing all data from lists.

I have also set the VC++ Optimization option in Settings
to Disable(Debug) but it doesn't work.

Does anyone known why I get these different results?? How
can I solve this problem???

Thanks



Thu, 13 Oct 2005 01:53:45 GMT  
 Different execution between Release and Debug version

Quote:

> Hi,

> I'm writing an application in Visual C++ which uses many
> CPtrList classes with a hundreds of nodes and I'm getting
> different results when using the Release or Debug version.

> My program crashes in the Release version when I try to
> delete all CPtrList classes but not in the Debug one. I
> use a loop (while (! list.IsEmpty()) ) and the RemoveHead()
> method for removing all data from lists.

> I have also set the VC++ Optimization option in Settings
> to Disable(Debug) but it doesn't work.

> Does anyone known why I get these different results?? How
> can I solve this problem???

> Thanks

One common reason is that in a debug build your variables are
initialized for you but in a release build they are not. So there is
more potential for garbage values if you omitted some initialization.
You can add temporary statements to your program to output information,
such as the addresses allocated and the addresses freed.  The output can
go to the de{*filter*} window (OutputDebugString) or to a file you create.

To run the release build in the de{*filter*} turn on the debug symbols in
the compile and link settings.

--
Scott McPhillips [VC++ MVP]



Thu, 13 Oct 2005 03:18:01 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Different arithmetics for debug and release version?

2. Dll's with different names for debug-/release-Version

3. different calculations in debug and release version ?

4. Different debug vs release version

5. Debug version - Release version

6. Debug version ok but release version problem

7. Debug Version and Release Version

8. Win32 debug version and Win32 release version

9. Why the Font size is not same between Debug version and Release Version

10. Debug version Ok, Release version Failed

11. Debug version ok but release version problem

12. Debug version works, Release version does not?!

 

 
Powered by phpBB® Forum Software