user382591
user382591

Reputation: 1390

Track access violation in Delphi

I'd like to track an access violation error which is triggered.

Threads are created and perform some jobs. I suspect them to access VCL or variables without "synchronise". The Madexcept report show that the access violation occurs on the form close (form1.close;), but no more precision.

I've got many lines of codes (around 100.000).

What should I do to avoid spending too much time ? I've checked "range checking" in the debugger option.

Many thanks

Upvotes: 0

Views: 2349

Answers (2)

Torbins
Torbins

Reputation: 2216

Try SafeMM, it will help you to catch errors sooner. Here is the video which gives detailed explanations. But be careful, this MM is only for debugging, don't enable it in Release versions of your software.

Upvotes: 0

Toon Krijthe
Toon Krijthe

Reputation: 53366

if you really want to know, you can build the project with debug dcu's and put a breakpoint just before the point the exception occurs.

Now you can jump into the VCL code and hopefully see what goes wrong.

But access violations in close or destructors are often because of double freeïng of object. For example, you free component that is also freed by the form (because it is owned by the form).

Upvotes: 1

Related Questions