[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me...
From: |
Joris van der Hoeven |
Subject: |
Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me... |
Date: |
Mon, 4 Nov 2002 22:29:27 +0100 (MET) |
> > +//void destroy_tree_rep (tree_rep* rep);
> > inline tree::tree (const tree& x): rep (x.rep) { rep->ref_count++; }
> > -inline tree::~tree () {
> > - if ((--rep->ref_count)==0) destroy_tree_rep (rep); }
> > +
> > +inline tree::~tree ()
> > +{
> > + if ((--rep->ref_count)==0) {
> > + //destroy_tree_rep (rep);
> > + delete rep;
> > + rep = NULL;
> > + }
> > +}
>
> I am a bit confused by this. Is this necessary?
> We should recursively delete the tree,
> so it does not suffice to just delete the pointer...
I see now; that is the purpose of the virtual destructor...
But now I am again confused, because the old routine
destroy_tree_rep should precisely do the same thing
as the virtual destructor. Apparently, a string is sometimes
not a string or a compound not a compound...
By the way, what is the effect of "rep = NULL" ?
This is the only real change I can see,
but I do not see why this should stabilize the code.
Maybe some destructor is called twice,
like it has been the case with g++-3.0,
and that the effect of your changes is to
make this less disastrous. What happens if
a virtual destructor is called for the NULL pointer?
Is that just ignored?
- [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Igor V. Kovalenko, 2002/11/03
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Joris van der Hoeven, 2002/11/04
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me...,
Joris van der Hoeven <=
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Igor V. Kovalenko, 2002/11/05
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Igor V. Kovalenko, 2002/11/05
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Igor V. Kovalenko, 2002/11/08
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., David Allouche, 2002/11/08
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Igor V. Kovalenko, 2002/11/08
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Joris van der Hoeven, 2002/11/08
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Igor V. Kovalenko, 2002/11/08
- Re: [Texmacs-dev] [PATCH] solves GCC 3.2 auto_save segfault for me..., Joris van der Hoeven, 2002/11/08
- [Texmacs-dev] GCC 3.2 segfaults..., Igor V. Kovalenko, 2002/11/08
- Re: [Texmacs-dev] GCC 3.2 segfaults..., Joris van der Hoeven, 2002/11/08