]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/grob.cc (Grob): idem. Plugs mem leaks.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 21 Nov 2004 18:30:59 +0000 (18:30 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 21 Nov 2004 18:30:59 +0000 (18:30 +0000)
* lily/context.cc (Context): unprotect key from ctor.

* lily/parser.yy (lilypond_header_body): copy previous
$globalheader if present.

* lily/ly-module.cc (LY_DEFINE): rename ly:import-module to
ly:module-copy

* scm/page-layout.scm (marked-up-headfoot): remove old functions.

* scm/titling.scm: remove old titling functions

* scm/page-layout.scm (marked-up-headfoot): create header/footer
field from user-supplied markup

* scm/titling.scm (marked-up-title): create title via
user-specified markup.

* lily/ly-module.cc (LY_DEFINE): use ly_module_lookup(). This does
not have side-effect of creating variable stub.

ChangeLog
lily/context-property.cc
lily/context.cc
lily/global-context.cc
lily/grob.cc
lily/score-engraver.cc
lily/score.cc
scm/lily.scm

index 56186211f7b849a56e3e6d41d225aa177cbc3ec8..e0c1541aa6c821a90691150dc0bcf5e6e4fa5b9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-11-21  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/grob.cc (Grob): idem. Plugs mem leaks. 
+
+       * lily/context.cc (Context): unprotect key from ctor.
+
        * scm/stencil.scm (stack-lines): return empty-stencil if argument
        is '()
        (stack-stencils): idem.
index bd5ccbf7b8f326d39a00feb51bd8f3b0d51403b0..496b9b120b3e35d42c614878066aae77a6527575 100644 (file)
@@ -203,7 +203,6 @@ make_item_from_properties (Engraver *tr, SCM x, SCM cause, const char * name)
 
   Object_key const*key = context->get_grob_key (name);
   Item *it = new Item (props, key);
-  scm_gc_unprotect_object (key->self_scm ());
 
   dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
 
index c85d5a6cbd399891e13f4add275cea07c841aaad..effb574d1c95a310d23290be1425477f1b8e98df 100644 (file)
@@ -98,9 +98,9 @@ Context::Context (Object_key const* key)
   definition_ = SCM_EOL;
   
   smobify_self ();
-
   properties_scm_ = (new Scheme_hash_table)->self_scm ();
   scm_gc_unprotect_object (properties_scm_);
+  scm_gc_unprotect_object (key_->self_scm ());
 }
 
 
@@ -181,7 +181,6 @@ Context::create_context (Context_def * cdef,
   Object_key const *key = get_context_key (type, id);
   Context * new_group
     = cdef->instantiate (ops, key);
-  scm_gc_unprotect_object (key->self_scm ());
          
   new_group->id_string_ = id;
   add_context (new_group);
index 7acf004cf1f09b218747e632ee67c13956ddcf51..e7be444321a2539668c63cedf0bfc8ae03adf286 100644 (file)
@@ -24,8 +24,6 @@ Global_context::Global_context (Output_def *o, Moment final, Object_key *key)
                                      Moment(0),
                                      "Global", "", 0))
 {
-  scm_gc_unprotect_object (key_->self_scm());
-  
   output_def_ = o;
   final_mom_ = final;
   definition_ = find_context_def (o, ly_symbol2scm ("Global"));
@@ -167,7 +165,6 @@ Global_context::run_iterator_on_me (Music_iterator * iter)
          Object_key const *key = get_context_key ("Score", "");
          Context *c = t->instantiate (SCM_EOL, key);
          add_context (c);
-         scm_gc_unprotect_object (key->self_scm());
 
          Score_context *sc = dynamic_cast<Score_context*> (c);
          sc->prepare (w);
index c6e442ec53535f6e22c2e3cd7e1582aa7582d2b4..c2d6a2d049f71a521f6f2c368b8d597103d7ebc8 100644 (file)
@@ -59,6 +59,10 @@ Grob::Grob (SCM basicprops,
      GC. After smobify_self (), they are.  */
   smobify_self ();
 
+  /*
+    We always get a new key object for a new grob.
+   */
+  scm_gc_unprotect_object (key_->self_scm ());
   SCM meta = get_property ("meta");
   if (scm_is_pair (meta))
     {
index f99ed6151d497ff49bd42768e9365f8314b5fdab..221a32ec07fd4126aed3ad0aef2bbb8358359f40 100644 (file)
@@ -53,9 +53,6 @@ Score_engraver::make_columns ()
       set_columns (new Paper_column (nmp, key1), new Paper_column (pc, key2));
 
 
-      scm_gc_unprotect_object (key1->self_scm());
-      scm_gc_unprotect_object (key2->self_scm());      
-
       Grob_info i1;
       i1.grob_ = command_column_;
       i1.origin_trans_ = this;
@@ -125,7 +122,6 @@ Score_engraver::initialize ()
 
   Object_key const *sys_key = context()->get_grob_key ("System");
   pscore_->typeset_line (new System (props, sys_key));
-  scm_gc_unprotect_object (sys_key->self_scm ());
   
   make_columns ();
   system_ = pscore_->system_;
index b758fde169abea3cd2f27eed67e3493a84b3a16c..453a72a73ec090c3987364282d2e01c05d1ce49e 100644 (file)
@@ -252,6 +252,7 @@ Score::book_rendering (String outname,
 
   Object_key * key = new Lilypond_general_key (book_key, user_key_, 0);
   SCM scm_key = key->self_scm();
+  scm_gc_unprotect_object (scm_key);
   
   for (int i = 0; !i || i < outdef_count; i++)
     {
index fd0ae671cd17fc3c819ba752a06205c73e173371..c1a0bdd125cd543969825260768f431be385b635 100644 (file)
@@ -248,12 +248,12 @@ predicates. Print a message at LOCATION if any predicate failed."
           (lambda (a b)
             (< (object-address (car a))
                (object-address (car b))))))
-       (outfile    (open-file (string-append
+       (out-file-name (string-append
               "gcstat-" (number->string gc-protect-stat-count)
-              ".scm"
-              ) "w")))
+              ".scm"))
+       (outfile    (open-file  out-file-name  "w")))
 
-    (display "DUMPING...\n")
+    (display "Dumping gc protected objs to ...\n")
     (display
      (filter
       (lambda (x) (not (symbol? x))) 
@@ -333,7 +333,7 @@ predicates. Print a message at LOCATION if any predicate failed."
     (for-each
      (lambda (f)
        (catch 'ly-file-failed (lambda () (ly:parse-file f)) handler)
-;;;       (dump-gc-protects)
+       (dump-gc-protects)
        )
      files)