[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: RFC: Proper destruction of static data?
From:       Harri Porten <porten () tu-harburg ! de>
Date:       2000-06-27 20:11:15
[Download RAW message or body]

Stephan Kulow wrote:
> 
> David Faure wrote:
> >
> > > Sounds very interesting. My comment/suggestion: order of destruction can
> > > be quite important. Therefore, it has to be well defined and documented.
> >
> > Right.... Then what about a "user-defined callout (per library)"
> > where the library's developer does a proper destruction, instead of having
> > it done automatically ? Hmm, more complex for the developer than just K_STATIC.
> >
> I would say if you use static objects, you don't care for the order of
> construction, so I don't see a point in having the destruction ordered

It's true that the order of construction is not guaranteed by the
compiler. In case of objects that depend on each other some tricks (like
singleton or factory) have to be used in enfore a proper construction.
Same should count for the deletion. But I admit that these cases are
very rare and the programmer could left be with the burden of ensuring
proper destruction ;)

Harri.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic