From: Paul B. <pa...@ei...> - 2008-08-11 19:30:03
|
We've detected a memory leak when using gobo data structure cursors that do not run to the end, and currently there is no way to clean them up nicely. Take the following code f (a_list: !DS_LINEAR [?ANY]) local l_cursor: DS_LINEAR_CURSOR [?ANY] l_stop: BOOLEAN do l_cursor := a_list.cursor from l_cursor.start until l_cursor.after or l_stop loop l_stop := l_cursor.item = Void if not l_stop then l_cursor.forth end end end Passing a linear structure to 'f' where any item is Void will cause the leak because the list never goes 'off'. We cannot call DS_TRAVERSABLE.remove_traversing_cursor and it is not a good idea to do so because it may have not been added the the managed list or cursors, given the current lazy-eval implementation. The current solution is to run out the cursor in another loop or run out the cursor in the original loop but conditionally process the loop's functional body. Neither of which look that nice. Best, Paul. |