- Messages
- 533
- Country

Hello,
I have a very strange question, not sure if anyone can help, but at least I try...
I have a piece of C++ code that uses GDI+, where all the pens and brushes are deleted (using delete) to be re-created (using new) with different parameters. This used to work perfectly, until I had a strange bug that caused a CTD. I searched and found this part of the code is the cause, so I debugged by writing the address of the pen and brush objects.
In FS2004, it is very straightforward: when a brush object is located at address X in memory, I delete it, create it again, and the address of the new created object still X, unchanged.
In FSX, the object has address X in memory, deleted, created, and appears with address Y. How can you explain this? Is there any difference in the way memory is managed in FSX? Hard to believe...
In both cases, the code is exactly the same, same computer, same OS, same compiler, and different behavior. If by any chance someone experienced a similar situation, please let me know.
Thanks for any help...
Eric
PS. This memory allocation difference is not a problem in itself. It appears that in some specific conditions (standard 737 loaded first with batteries off, then my aircraft loaded and batteries switched on), it crashes and the display of memory addresses shows that an address is corrupted, as if it was erased by a memory overflow or something I can't explain...
I have a very strange question, not sure if anyone can help, but at least I try...
I have a piece of C++ code that uses GDI+, where all the pens and brushes are deleted (using delete) to be re-created (using new) with different parameters. This used to work perfectly, until I had a strange bug that caused a CTD. I searched and found this part of the code is the cause, so I debugged by writing the address of the pen and brush objects.
In FS2004, it is very straightforward: when a brush object is located at address X in memory, I delete it, create it again, and the address of the new created object still X, unchanged.
In FSX, the object has address X in memory, deleted, created, and appears with address Y. How can you explain this? Is there any difference in the way memory is managed in FSX? Hard to believe...
In both cases, the code is exactly the same, same computer, same OS, same compiler, and different behavior. If by any chance someone experienced a similar situation, please let me know.
Thanks for any help...
Eric
PS. This memory allocation difference is not a problem in itself. It appears that in some specific conditions (standard 737 loaded first with batteries off, then my aircraft loaded and batteries switched on), it crashes and the display of memory addresses shows that an address is corrupted, as if it was erased by a memory overflow or something I can't explain...



