Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Sorry to ask this here but ...
Thu, Jul 13 2006 10:45 AMPermanent Link

adam
Sorry to ask this here, I am working on a DBISAM Delphi project in Uganda at the moment &
only have access to a few web-sites to ask the question!

I am having a persistent fault on-close of my DB app ... "invalid pointer operation"

I am 100% certain the problem is some object attempting to free another object which has
already been freed, or something similar. I just need to find the point where the error
occurs. However when I step through the project I hit a procedure which is called 100's of
times & I can't reach the end using F7 or F8.

Can I exclude a single procedure from the "step" process in Debug?
Can I exclude a whole unit from debug, while still using the code in the project?

... These are silly newbie questions, but I can't find them covered anywhere in my help!

Adam Brett
Thu, Jul 13 2006 11:40 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

adam

>I am 100% certain the problem is some object attempting to free another object which has
>already been freed, or something similar. I just need to find the point where the error
>occurs. However when I step through the project I hit a procedure which is called 100's of
>times & I can't reach the end using F7 or F8.

I know the feeling Smiley


>Can I exclude a single procedure from the "step" process in Debug?

NO! (much gnashing of teeth)

>Can I exclude a whole unit from debug, while still using the code in the project?

YES - just add {$D-} at the start (I usually stuff it the line after Unit.....)

Don't forget to Alt-P-B after you've made the change

Roy Lambert
Thu, Jul 13 2006 2:17 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< I am 100% certain the problem is some object attempting to free another
object which has already been freed, or something similar. I just need to
find the point where the error occurs. However when I step through the
project I hit a procedure which is called 100's of
times & I can't reach the end using F7 or F8. >>

If you're using a tree view or list view with an attached data pointer in
the items, make sure that you always free the item before freeing the
object/data that is pointed to by the data pointer.  That one always trips
me up.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jul 13 2006 2:43 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


>If you're using a tree view or list view with an attached data pointer in
>the items, make sure that you always free the item before freeing the
>object/data that is pointed to by the data pointer. That one always trips
>me up.

That really baffles my brain. Free the treeview before you free the objects?

Roy Lambert
Fri, Jul 14 2006 1:46 AMPermanent Link

"Clive"
Hi Adam,

Install MadExcept if should report the source code line the error is
occuring on

Thanks
Clive.

"adam" <adam@nospameplease.fmfoods.co.uk> wrote in message
news:22CF27D1-567B-4062-B599-7712DC57F5AE@news.elevatesoft.com...
> Sorry to ask this here, I am working on a DBISAM Delphi project in Uganda
> at the moment &
> only have access to a few web-sites to ask the question!
>
> I am having a persistent fault on-close of my DB app ... "invalid pointer
> operation"
>
> I am 100% certain the problem is some object attempting to free another
> object which has
> already been freed, or something similar. I just need to find the point
> where the error
> occurs. However when I step through the project I hit a procedure which is
> called 100's of
> times & I can't reach the end using F7 or F8.
>
> Can I exclude a single procedure from the "step" process in Debug?
> Can I exclude a whole unit from debug, while still using the code in the
> project?
>
> .. These are silly newbie questions, but I can't find them covered
> anywhere in my help!
>
> Adam Brett
>

Fri, Jul 14 2006 4:07 AMPermanent Link

adam
Wow guys ... thanks for these great responses ... not even 1 snide comment about how I
ought to know better!

The {D$-} tip is the one I wish I'd known 5 years ago! (where is that in the Delphi help!!!)

Tim is spot on about trees too, but I use something called "virtualtreeview" (can't
recommend it strongly enough - freeware, Delphi Gems) which I have sorted out not to give
that problem.

I will check out MadExcept ...

Adam
Fri, Jul 14 2006 5:51 AMPermanent Link

"Jan Derk"
adam wrote:

> I am 100% certain the problem is some object attempting to free
> another object which has already been freed, or something similar. I
> just need to find the point where the error occurs.

If you use FastMM4 in full debug mode it will give you three call
stacks, one for where the object was created, one for when the object
was freed and one for where the code is trying to access the already
freed object. FastMM4 is amazing for these kind of problems.

Jan Derk
Fri, Jul 14 2006 2:45 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< That really baffles my brain. Free the treeview before you free the
objects? >>

No, I meant freeing any treeview item before you free the object/pointer
that is attached to the item via its Data property. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Image