]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 5057/7: Stop SCM/int confusion in program-option code
authorDavid Kastrup <dak@gnu.org>
Sat, 4 Feb 2017 23:36:17 +0000 (00:36 +0100)
committerDavid Kastrup <dak@gnu.org>
Sat, 11 Feb 2017 07:49:56 +0000 (08:49 +0100)
lily/program-option-scheme.cc

index 3934217fb3c9b64ade82becc20aaff47e036ef6d..88d16e167f94e904b99e0a6f111776e9c05d70f4 100644 (file)
@@ -30,6 +30,7 @@ using namespace std;
 #include "string-convert.hh"
 #include "warn.hh"
 #include "lily-imports.hh"
+#include "protected-scm.hh"
 
 bool debug_skylines;
 bool debug_property_callbacks;
@@ -45,7 +46,7 @@ bool profile_property_accesses = false;
 bool do_internal_type_checking_global;
 bool strict_infinity_checking = false;
 
-static SCM option_hash;
+static Protected_scm option_hash;
 
 void
 internal_set_option (SCM var,
@@ -190,8 +191,8 @@ LY_DEFINE (ly_add_option, "ly:add-option", 3, 0, 0,
            "Add a program option @var{sym}.  @var{val} is the default"
            " value and @var{description} is a string description.")
 {
-  if (!option_hash)
-    option_hash = scm_permanent_object (scm_c_make_hash_table (11));
+  if (!option_hash.is_bound ())
+    option_hash = scm_c_make_hash_table (11);
   LY_ASSERT_TYPE (ly_is_symbol, sym, 1);
   LY_ASSERT_TYPE (scm_is_string, description, 3);