| 
| [DataBinding] DataBindingContext doesn't call dispose on used IObservables [message #337048] | Thu, 23 July 2009 21:36  |  | 
| Eclipse User  |  |  |  |  | Hi All, 
 I'd thought I'd ask first before filing a bug report.
 
 I sometimes add ListChangeListener to the DataBindingContext#getBindings()
 to track bindings being added and removed, so I can add generic behaviour
 to them with out manually adding the listeners to each binding. However,
 cleaning up is a hassel as I can't detect when the DataBindingContext gets
 disposed. The DataBindingContext itself doesn't have a addDisposeListener
 method and the underlying IObservableList that it uses are not disposed
 when DataBindingContext#dispose is called. (dispose is called on each Bind
 held in the IObservableList, but not on the IObservableList itself).
 
 Would it be possible to modify DataBindingContext#dipose() so that it
 called dispose on the IObservables it used?
 
 bindings.dispose()
 unmodifiableBindings.dispose() //(Calling dipose on a wrapping collection
 doesn't call dispose on the wrappee)
 validationStatusProviders.dispose()
 unmodifiableStatusProviders.dispose()
 validationStatusMap.dispose()
 
 Is there another way to do it?
 
 Cheers,
 
 Ashley Cambrell
 |  |  |  | 
| 
| Re: [DataBinding] DataBindingContext doesn't call dispose on used IObservables [message #337073 is a reply to message #337048] | Sun, 26 July 2009 11:52  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 No because you can in theory share observables between databinding
 contexts. In 3.5 a new class named ObservableTracker was added but
 because we discovered a late bug it's not useable until 3.5.1.
 
 Tom
 
 Ashley Cambrell schrieb:
 > Hi All,
 >
 > I'd thought I'd ask first before filing a bug report.
 >
 > I sometimes add ListChangeListener to the
 > DataBindingContext#getBindings() to track bindings being added and
 > removed, so I can add generic behaviour to them with out manually adding
 > the listeners to each binding. However, cleaning up is a hassel as I
 > can't detect when the DataBindingContext gets disposed. The
 > DataBindingContext itself doesn't have a addDisposeListener method and
 > the underlying IObservableList that it uses are not disposed when
 > DataBindingContext#dispose is called. (dispose is called on each Bind
 > held in the IObservableList, but not on the IObservableList itself).
 >
 > Would it be possible to modify DataBindingContext#dipose() so that it
 > called dispose on the IObservables it used?
 >
 > bindings.dispose()
 > unmodifiableBindings.dispose() //(Calling dipose on a wrapping
 > collection doesn't call dispose on the wrappee)
 > validationStatusProviders.dispose()
 > unmodifiableStatusProviders.dispose()
 > validationStatusMap.dispose()
 >
 > Is there another way to do it?
 >
 > Cheers,
 >
 > Ashley Cambrell
 >
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.04842 seconds