Le 01/10/2011 02:04, Tommaso Cucinotta a écrit :
These are just cleanup ops that are not explicitly done on program exit,
but not a big deal, actually. They could help in having a better cleanup
of LyX at exit, but I'm not sure any of these deserves to be committed
(pls, comment).

I think such patches are valuable (at least in trunk) because they remove noise.

The patch makes sense to me, but I'd prefer to have other people look at it. The destructor part of GuiApplication does not look right to me:

First of all, this should be in the destructor of GuiApplication::Private.

+       if (d->language_model_)
+               delete d->language_model_;

I thought delete 0 was safe and the test was not needed

+       d->socket_notifiers_.clear();

Isn't this done automatically by the destructor?

+       if (d->global_menubar_) {
+               
+               d->global_menubar_ = 0;
+       }

As above, only "delete d->global_menubar_;" is needed IMO.


In TocModel:

-       for (iterator it = models_.begin(); it != end;  ++it)
+       for (iterator it = models_.begin(); it != end;  ++it) {
                it.value()->clear();
+               delete it.value();
+       }
+       models_.clear();
 }

Is it necessary to do a clear of the object is deleted anyway?

JMarc

Reply via email to