I am receiving an access violation after I recompile a certain unit (MyClass) unless I do a clean. The error is clearly a call to a null object (Write of address 00000000), but when I try to step to it, the compiler won't allow me to step into the code where I think the error is occurring. (Inside a method on the same object. When i trace into the method, there error after hitting trace into but before going to the line of code.) This happens in a used unit of MyClass, rather than MyClass itself.
The weird thing is that if I do a clean (or build) and then recompile, the program runs fine. Any reason this would happen?
Update
The application uses several threads created via the AsyncCalls library. I use several TEvent
and TMultiReadExclusiveWriteSynchronizer
objects to keep processes ordered and resources protected. Does any special care need to be taken when creating or freeing such objects?