Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dangling reference?
Message
From
18/08/2010 19:42:57
 
 
To
31/07/2010 02:43:51
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01474712
Message ID:
01477200
Views:
238
>Thomas,
>
>Thanks for your reply.
>
>Nope. The files you are trying to change are still in use and therefore "blocked". See clea program and set classlib to / set proc to
>which can be put in a snippet called on shutdown or by hand.

>
>How do you mean? Actually I use the same technique (using collections) for my DE class. This is the first time I used collections with images.
>
>BTW, I changed how I did it and instead used array properties to handle it. It is working now. No more of those s***ty behavior. =)
>
>Still though, I would like to know how to solve this if one elects to use Collection Objects.
>
>Dennis

Dennis

IMHO somewhat related to your problem, the collection class is quite flaky. Prone to C5's. Just ask Jim Nelson of PEM Editor fame.

You are better off using the array. Much safer too. The collection may look ok now and easier to program using For...Each but this can come back to bite you as I have found, in a large application.

Regarding your problem, you have a typical "Fatal Lock" type problem. The Container instantiates the Collection and images. The Collection in turn holds an instance of the images in itself. So you have this problem since the container holds on to the instances.

You could try removing the instances in reverse order.

Add code in the collection to release the images
Add code in the container to release the collection

Might work, but better to steer clear of collections. Also do a Google on this term _NewENum It is used in collections but not properly in VFP as it is not hidden.

What I have found when debugging C5's with VFP collections, is that this "hidden" property manifests itself in the VFP Properties window, just before an imminent C5 crash.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform