|
-
September 30th, 2010, 10:04 PM
#16
Re: C++ Unhandled exception error
 Originally Posted by itsmeandnobodyelse
No, the error message you got means that the process runs out-of-memory. You therefore need to locate all calls where the process requests for memory (and the function called returns a pointer to that memory). Then you need to check whether the memory was freed later. I spotted one call where you load the model but where you never delete the pointer. If that function was called 1024 * 768 times you definitively have a memory problem even for big physical memory...
If I am right the exception is only a follow-up of the fact that the system can't provide ay more memory.
Thank you so much for help
I think I did what you suggested (to the best of my knowledge)
to locat memory I used the expressions such as :
unsigned char *pixels_index_temp = new unsigned char[144];
and after using the pointer the memory was freed using delete:
delete [] pixels_index_temp;
also, the model and the image loaded were deleted using cleanup function and delete image.
the function (update) is the only function that can return a pointer to the array pixels_index, but the array should be kept to be displayed within the same function and delete it later.
this funtion should load the image and the model 128*128 times and form the data array pixels_index_temp, this array will be displayed using OpengGL commands.
I got the same result with the same messages saying:
Unhandled exception at 0x7c812afb in OPENGL_......exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012fbb4..
and
There is no source code available for the current location.
and here i sthe last bit of information displayed just before it crashes, these are information about the values stored in the array pixels_index and the address of the array pixels_index_temp before and after using the function delete (the same address):
row_index 20
the value stored in pixels_index[384351] B
row_index 20
the value stored in pixels_index[384354] /
row_index 20
the value stored in pixels_index[384357] ö
address of pixels_index_temp BEFORE delete 0012FF1C
address of pixels_index_temp AFTER delete 0012FF1C
address of pixels_index 0012FF20 (only 4 bytes after the address of pixels_index_temp)
address of _model 004097E0
I hope to have any idea from you.
Tags for this Thread
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
|