[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] destroy_tree_rep change is a no-op...
From: |
Joris van der Hoeven |
Subject: |
Re: [Texmacs-dev] destroy_tree_rep change is a no-op... |
Date: |
Wed, 6 Nov 2002 00:03:05 +0100 (MET) |
> diff -udBbr TeXmacs-1.0.0.20-src/src/Basic/Data/tree.cc
> TeXmacs-1.0.0.21-src-orig/src/Basic/Data/tree.cc
> --- TeXmacs-1.0.0.20-src/src/Basic/Data/tree.cc 2002-10-24
> 19:10:08.000000000 +0400
> +++ TeXmacs-1.0.0.21-src-orig/src/Basic/Data/tree.cc 2002-11-05
> 19:26:37.000000000 +0300
> @@ -20,6 +20,7 @@
> destroy_tree_rep (tree_rep* rep) {
> if (rep->op == STRING) delete ((atomic_rep*) ((void*) rep));
> else delete ((compound_rep*) ((void*) rep));
> + rep= NULL;
> }
>
> This zeroing the rep is a no-op, as tree_rep* is passed by value.
> The one in tree_rep::~tree_rep would be more appropriate or there
> should be destroy_tree_rep(tree_rep* & rep) instead. The point is in
> zeroing-out the pointer in appropriate *tree data* so
> we catch the dereference later IMO...
Oh yes, of course, I must have been very tired...