changing the UNO dispose/disposing() protocol ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I would like to change the existing UNO dispose()/disposing() protocol.

Specifically, I would like to change the part where if a component is already disposed, it throws a DisposedException. Instead it should simply ignore the call (i.e. return early)

The reason for this, is threefold

(1) Very little of the calling code seems to know, or care, if child components throw this exception. It is almost never caught. When it _is__ thrown, the only real effect is that it prevents other child components from being disposed.

(2) In a complex web of components, it may not be possible to know with certainty if some other object has been disposed or not.

(3) In general, protocols of this category (e.g. closing a file) are designed to ignore repeated calls, so our current design is a bit of an outlier.

I can't see how changing this will make anything worse - anything that currently catches DisposedException will simply no longer exercise that catch path.

It might cause some regressions where code paths are currently being silently dropped because of a DisposedException, but then that code was buggy already.

Regards , Noel Grandin.



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux