From: fred Date: Sun, 24 Mar 2002 19:43:55 +0000 (+0000) Subject: lilypond-0.0.65 X-Git-Tag: release/1.5.59~4695 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7f91aa4395658d952d8a0501e3b5653ab09b5908;p=lilypond.git lilypond-0.0.65 --- diff --git a/flower/include/plist.hh b/flower/include/plist.hh index 469a8d444a..4c9d71dba5 100644 --- a/flower/include/plist.hh +++ b/flower/include/plist.hh @@ -33,23 +33,30 @@ class Link_list : public List Link_list() {} }; -/** Link_list which deletes pointers given to it. +/** + + Link_list which deletes pointers given to it. + NOTE: The copy constructor doesn't do what you'd want: Since T might have a virtual ctor, we don't try to do a - new T(*cursor) + new T(**cursor) You have to copy this yourself, or use the macro Link_list__copy + TODO + operator =() */ template class Pointer_list : public Link_list { + public: + void junk(); Pointer_list(Pointer_list const &) { set_empty(); } Pointer_list() { } - ~Pointer_list(); + ~Pointer_list() { junk(); } }; #define Pointer_list__copy(T, to, from, op) \ diff --git a/flower/include/plist.tcc b/flower/include/plist.tcc index 2f75d08adf..ba4a0f20b0 100644 --- a/flower/include/plist.tcc +++ b/flower/include/plist.tcc @@ -6,7 +6,8 @@ template class Pointer_list template -Pointer_list::~Pointer_list() +void +Pointer_list::junk() { PCursor c( *this ); while (c.ok()) {