Re:Help -- can SaveToFile really cause a Memory Leak!???
Quote
APM wrote:
> I'm having a really confusing problem! After taking weeks to track
> down a memory leak, I seem to have isolated the problem to the
> SaveToFile method associated with a TString from a TListBox.
APM?,
I am not aware of this particular problem but in my company we have
written years ago a DOS driver that communicates with external
instruments, and it have worked well for years, until we switched to
W95. Then, each time we did an access to the driver (which is usually
done by the succession assign, rewrite, write, close) a memory leak
occured. Since we do this several times a second, you imagine the
consequences! They contacted Microsoft who acknowledged this was a bug,
but they had no plans to correct it. So we had to find a workaround
solution. It consisted in writing a DLL that opened the driver (=file)
at the beginning of the session and closed it at the end. This DLL could
serve several applications that used the same driver to communicate to
outside the PC, thanks to a mailbox scheme implemented in the DLL.
I am sorry not to bring you an explanation, but I think you should not
be surprised to find bugs of that kind, though all the qualities we find
to W95.
Jean-Marc