Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddObject/CreateObject
Message
From
22/03/2002 09:59:35
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00633293
Message ID:
00636022
Views:
23
>Len,
>
>>I don't think a 'memory leak' is going to be a problem, but eventually running out of memory might be. The added object is retained in the controls array of the form & the controlcount is not decremented when using your method of adding to an array, whereas when adding uniquely named objects, the object is removed from the control array & the countrol count decremented.
>
>You could also put some code in the Release() method of the form that removes all objects, that were added at runtime. Just scan through the array and do a RemoveObject() for each control.
>
>Armin

There's no problem on the release of the form - as the objects are still in the controls array, this is automatically done.

The problem is in removing the object prior to the release of the form. My original problem was to avoid the need to generate unique object names & I can see there's no way around that.

At the moment there's no requirement for access to the object except in response to it's own events, so I dont really need to know the name of the object - so I can probably do away with the array.
Len Speed
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform