Author: qmathe
Date: Sat Jun 21 11:51:23 2008
New Revision: 3202
URL: http://svn.gna.org/viewcvs/etoile?rev=3202&view=rev
Log:
Fixed the memory management in the layout item tree (longstanding issues).
Until
now, all the items were leaked. Tests indicate everything should be properly
released now. To simplify memory management and reduce code verbosity,
implemented a cycle detection in -release for ETLayoutItem and ETView (it's a
bit in the vein of the cycle detection implemented by the AppKit for the text
system, just a lot simpler). Anxiously waiting to a sweet GC that deal with
this
kind of stuff :-)
Result: 16 classes, 48 methods, 322 tests, 0 failed
* ETView:
(-init): New initializer that pass a default frame.
(-initWithFrame:layoutItem:)
(-dealloc)
(-setLayoutItemWithoutInsertingView:):
Modified to take in account the retain cycle as needed by -release.
(-release): New overriden method that implements a cycle detection in a GC-like
fashion.
* ETLayoutItem:
(-dealloc)
(-setParentLayoutItem:): Turned _parentLayoutItem into a weak reference, this
eliminates all retain cycles between children and parents that translated into
memory leaks until now.
(-release): New overriden method that implements a cycle detection in a GC-like
fashion.
Written a bunch of new tests to check the memory management in the layout item
tree.
Modified:
branches/qmathe/Container/ETLayoutItem.m
branches/qmathe/Container/ETView.m
branches/qmathe/Container/Tests/test_ETView.m
_______________________________________________
Etoile-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-cvs