Delete persistent procedure

Alextrs

New Member
Hello,
Do we have a trigger in Progress to catch closure of procedure (OE 10.1C)?
We have iLib.i library and use it in 1** programs, this source has some functions, but somebody wrote it with bad behavior, each time when you invoke any function from this include file it:
1.
Code:
run calc.p persistent set hLib.
2.
Code:
run Get*** in hLib.
3.
Code:
delete object hLib.
I tried to remove 1st step outside of functions and it starts to work in n-times faster, but now I don't know how to delete this persistent procedure after the end of the main procedure (without rewriting of 100 sources).

Thank you!
 
To me it's not entirely clear what code is in the library and what your problem is.

Is your problem that it takes too long to start the persistent procedure?

Is the code for step 1, step 2 and step 3 in your include library?

How do you invoke the include library in your code?

When you need to delete a persistent procedure for which you don't have the handle pointing to it then you can use the technique of the widget-tree walk (in this case procedure-tree walk) ...



Regards,
RealHeavyDude.
 
Run the persistent procedure once on session startup. Remove the line which runs it and the line which deletes it when the include file is included. Then just let it sit in memory through the entire session.

For extra easy usage remove the "hLib" noise and have the PP install itself as a session super procedure. The all you have to do is "run get*" when you need to.
 
Progress needs a garbage collector, but it doesn't have one (though I heard a rumour there is one coming for classes, but not PP's). So basically you need to follow one of the above suggestions, or, make sure every instantiator deletes it when it's done.
 
In 10.2A it does have a garbage collection, _BUT_ not for handle base objects :(.

But: Do you really want to rely on a garbage collection. Here we have java developers sitting right next door to me and more then often I hear them swearing about garbage collection as big as some 100 Megabytes large ...

Therefore I like to take responsability for destroying objects. I NEW or CREATE them - I destroy them. But that's just my opinion.

Regards,
RealHeavyDude.
 
Back
Top