X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Finterpretation-context-handle.cc;h=ef840ebf9a3de2d9113d3f0d724f14d4d0018d1e;hb=7aabfb20c46e0a1de41698ddc6859ccd3a6dea85;hp=fddebdf9a7aa245106431063dbc609ff6cb8f99c;hpb=fc3e875d6bf06f0680e897faffdcab36ad975a03;p=lilypond.git diff --git a/lily/interpretation-context-handle.cc b/lily/interpretation-context-handle.cc index fddebdf9a7..ef840ebf9a 100644 --- a/lily/interpretation-context-handle.cc +++ b/lily/interpretation-context-handle.cc @@ -1,11 +1,9 @@ /* - interpretation-context-handle.cc -- implement Interpretation_context_handle source file of the GNU LilyPond music typesetter - (c) 1999--2001 Han-Wen Nienhuys - + (c) 1999--2003 Han-Wen Nienhuys */ #include "interpretation-context-handle.hh" @@ -13,71 +11,88 @@ Interpretation_context_handle::Interpretation_context_handle () { - report_to_l_ =0; + report_to_ =0; } Interpretation_context_handle::Interpretation_context_handle (Interpretation_context_handle const&s) { - report_to_l_ =0; - if (s.report_to_l_) - up (s.report_to_l_); + report_to_ =0; + if (s.report_to_) + up (s.report_to_); } Interpretation_context_handle* Interpretation_context_handle::clone () const { Interpretation_context_handle* handle = new Interpretation_context_handle; - handle->report_to_l_ = this->report_to_l_; + handle->report_to_ = this->report_to_; return handle; } Interpretation_context_handle::~Interpretation_context_handle () { - if (report_to_l_) - down (); + /* + Don't do + + if (report_to_) + down (); + + with GC, this is asynchronous. + */ } void Interpretation_context_handle::up (Translator_group*t) { - report_to_l_ = t; + report_to_ = t; t->iterator_count_ ++; } void Interpretation_context_handle::down () { - report_to_l_->iterator_count_ --; - report_to_l_ = 0; + report_to_->iterator_count_ --; + report_to_ = 0; +} + +void +Interpretation_context_handle::quit () +{ + if (report_to_) + { + report_to_->iterator_count_ --; + report_to_ = 0; + } } bool Interpretation_context_handle::try_music (Music *m) { - return report_to_l_->try_music (m); + return report_to_->try_music (m); } void Interpretation_context_handle::operator = (Interpretation_context_handle const &s) { - set_translator (s.report_to_l_); + set_translator (s.report_to_); } void Interpretation_context_handle::set_translator (Translator_group*trans) { - if (report_to_l_ ==trans) + if (report_to_ ==trans) return; - if (report_to_l_) + if (report_to_) down (); if (trans) up (trans); } Translator_group* -Interpretation_context_handle::report_to_l ()const +Interpretation_context_handle::report_to ()const { - return report_to_l_; + + return report_to_; }