[progress Communities] [progress Openedge Abl] Forum Post: Re: Class And Delete Object Xxxxx

  • Thread starter Thread starter Laura Stern
  • Start date Start date
Status
Not open for further replies.
L

Laura Stern

Guest
Coming from the Progress Software Corporation side, I would say that the recommendation to use garbage collection is a simplification. There are advantages/disadvantages on both sides: * There is nothing wrong with doing DELETE OBJECT if you are sure that the object is not being used anywhere. If it is not a straight-forward scenario and thus you are not sure, it's better to let garbage collection take care of it. * The AVM does not garbage delete an object when it is part of a circular reference. For those cases, you may want to use DELETE OBJECT (the other way is to break the circle by clearing one or more references). This usually comes up with Forms and and classes that use event subscriptions. Though again, when you do it, you have to be sure that you are not deleting something that is being used. In the example that started all this, with doing NEW in a loop and assigning the new class reference into the same variable each time, there is no ambiguity. Garbage collection will handle this just fine and there is no need whatsoever for DELETE OBJECT. And for the same reason, there is no problem if you do use DELETE OBJECT. So take your pick.

Continue reading...
 
Status
Not open for further replies.
Back
Top