Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Toolbar, removing container
Message
From
02/11/2017 16:09:26
 
 
To
02/11/2017 15:25:27
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01655282
Message ID:
01655376
Views:
48
Hi Dragan,

I checked the collection *after* all the code would have finished running. That is, the command button inside the container was invoking code at the toolbar level to release the container. It would render the container invisible (automatically, so that must be a first step to releasing it) but then when I would check, the object would not be removed from the collection of objects for the toolbar.

So it seems that even though the code would have completed, because initially you cannot (it seems) remove an object that still has code running (which makes sense), even though the code completes, this somehow causes the object to not be released.

Albert


>Just thinking now about the initial problem. When did you check whether the object still existed? Because I seem to remember that an object won't be released as long as the code in it or any of its members is running. So if you have something that releases its parent, I guess the code running keeps the reference count from reaching zero. When the code exits, the reference count finally drops to zero and the object releases.
>
>Not sure this is how it works, something just rang a bell during this discussion and I remembered that "it will release when the code exits", though in the cases I had, 12-15 years ago, it was something like this.release(). But I guess it may hold for cases when it's member's code.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform