Re: Class-Scope Properties



Eric Lemings <eric b lemings lmco com> writes: 
Again, I'm only bringing this up because the debug code in GObject
checks for stale references at program exit and so I get reports of
stale object references since there's no logical place to release a
class property.

Well, there isn't in C++ either, except destructors that run on
program exit. The lifetime of globals and statics is the lifetime of
the program. (And my view is that constructors/destructors on global
variables are almost always a terrible idea, for the same reason that
atexit() is a terrible idea... these things run in undefined order, at
an undefined time, when your app is in an undefined state... you get
the picture.)

Anyway, GLib has no way to run stuff at exit, short of atexit(). You
could always install your own atexit() handler to free things, I
guess.

Havoc




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