]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context.cc
Issue 5024: Rework the Preinit framework into something simpler
[lilypond.git] / lily / context.cc
index ef6fecf4b1aa123e566d858c4a576f2c3f45951e..a614146058f55273bc2070d0976c356d10d346b7 100644 (file)
@@ -49,9 +49,13 @@ Context::check_removal ()
       ctx->check_removal ();
       if (ctx->is_removable ())
         {
-          recurse_over_translators (ctx, &Translator::finalize,
-                                    &Translator_group::finalize,
-                                    UP);
+          recurse_over_translators
+            (ctx,
+             Callback0_wrapper::make_smob
+             <Translator, &Translator::finalize> (),
+             Callback0_wrapper::make_smob
+             <Translator_group, &Translator_group::finalize> (),
+             UP);
           send_stream_event (ctx, "RemoveContext", 0, 0);
         }
     }
@@ -90,8 +94,7 @@ Context::Context ()
 
   smobify_self ();
 
-  Scheme_hash_table *tab = new Scheme_hash_table;
-  properties_scm_ = tab->unprotect ();
+  properties_scm_ = Scheme_hash_table::make_smob ();
   event_source_ = new Dispatcher ();
   event_source_->unprotect ();
   events_below_ = new Dispatcher ();
@@ -753,6 +756,11 @@ Context::print_smob (SCM port, scm_print_state *) const
   return 1;
 }
 
+void
+Context::derived_mark () const
+{
+}
+
 SCM
 Context::mark_smob () const
 {
@@ -773,10 +781,12 @@ Context::mark_smob () const
   if (events_below_)
     scm_gc_mark (events_below_->self_scm ());
 
+  derived_mark ();
+
   return properties_scm_;
 }
 
-const char Context::type_p_name_[] = "ly:context?";
+const char * const Context::type_p_name_ = "ly:context?";
 
 Global_context *
 Context::get_global_context () const