Mail Archives: djgpp/2003/07/22/17:40:17
My problem is finally solved now... I did the following:
I installed djdev 2.04, where malloc_debug and malloc_verify are
implemented in the libc, recompiled with malloc debugging level to 4. I
had to use some tricks to read the error output, because right after the
abort due to the memory problem, I got in an infinite 'abort' loop
somewhere in the allegro_exit function. It turned out that the 'fixpage'
pointer (see first post, with the code) and the associated struct fields
were always involved in these crashes. Then I suddenly spotted the
problem in my code. Normally I set a pointer to NULL after deleting its
object, and I do the same for bitmap pointers after calling
destroy_bitmap; I check pointers against being zero before trying to
delete or destroy them. Forgetting to set the pointer to NULL after a
destroy_bitmap one time was enough to cast this nightmare upon me. I
added the line to do so, and behold.... my program doesn't crash. I
deleted the malloc_dbug statement though, because of the errors I
receive when shutting down the program.
Conclusion: I lost a lot of time, but at least I learned a lot about
debugging.
Many thanks to everyone who helped me sorting out this problem!
Cheers,
Peter.
- Raw text -