rhelgeby / smprojectbase

Automatically exported from code.google.com/p/smprojectbase
0 stars 0 forks source link

Cleanup function for objectlib (recursive deletion of objects and data) #80

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When the KeyValue parser in objectlib creates a object tree, you need to delete 
it when you're done with it.

Create a helper function to fully delete a tree recursively. It has to loop 
through keys to see which keys that have deletable data (objects, types, 
collections, handles).

This function can't know if a reference is valid, but has to try without 
interrupting further deletion. This can be done in a callback. Errors in a 
callback won't interrupt the caller.

If there's an error in a callback the result value will be 0. The callback 
should therefore always return 1 (or anything else than 0) so that the caller 
can check if it was successful.

Original issue reported on code.google.com by richard.helgeby@gmail.com on 14 Jun 2013 at 2:52

GoogleCodeExporter commented 9 years ago

Original comment by richard.helgeby@gmail.com on 23 Dec 2013 at 6:33