Advertisement

It freezes

Started by January 31, 2003 07:18 AM
8 comments, last by encom 22 years, 1 month ago
Hi, I have made an opengl viewer with animations... When it runs more than 15minutes, it freezes the PC !!!! I cant ping the crashed computer, nothing to do, just reset. It does the same with linux and NT ! There is no blueScreen with windows, no error popup, nothing, just frozen ! It can''t be a memory overlap, or anything else, because if it was memory pb, the os display an error messsage. It can''t be a hardware pb, i try it with many computers. So what is the pb ? thanks
Can you run other opengl application over 15 minutes ??
if not it maybe something about your hardware...
Advertisement
Yes, I can run quake3 during 3 houres !!!
WEIRD
Actualy it can be a memory problem.
One possible case is that you load up so much stuff that you use up all of your memory
Second Case is that your program has a memory leak . Which means you delete the pointer but u dont delete what it points too.

Operationg system can''t detect a memory leak !!!!!!
So there would be any errors
char *lump;

void alloc()
{
lump = new char [300];
fread(lump, 1, 300, filePointer);
}

void dealloc()
{
delete lump;
// free (lump);
}

main()
{
alloc();
dealloc();
}

in the dealloc func, should i use delete or free ?
Advertisement
the general rule is use delete with new and free with malloc
yes but here, i use both new and malloc (fread)
I think that if you are deleting an array you use
delete[], and not just delete...
quote:
yes but here, i use both new and malloc (fread)


No, you are only using new. fread is NOT malloc, why would you think that it is?

You must use delete [] in this case.
...keeping it simple...

This topic is closed to new replies.

Advertisement