Mail Archives: djgpp/1998/03/06/15:30:58
Mauro Toniolo wrote:
>
> I have created a class to handle with the matrixes. When I compile a listing
> that uses the class with the default destroyer, after a few iteration I get
> an overflow memory error. Surely, it's due by the wrong management of the
I looked at your class and yes if you use new() in the constructor it
needs to have a corresponding delete called.
> memory with this kind of destroyer. But if I define a destroyer like the
> following, I get the error below NOT in compiling time BUT in executing
> time. Why? HOW CAN I DESTROY THAT OBJECT?
>
.....
> Attached you can find the class I wrote:
>
> --------------------
> Exiting due to signal SIGSEGV
Your destructor looks fine.
After a brief look, your destructor looks fine to me.
A guess is that one of the objects being deleted in not allocated
or has been made to point elsewhere.
run gdb on the program and when it fails call the stack and check
your values.
Personally thats one of the things I like about protected mode
programing is that these kind of problems get picked up on the spot.
good luck
Charles Terry
- Raw text -