X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fpbd%2Fstateful.cc;h=8b8219f7e2243306f201f95257b035ec20b18cf0;hb=78b82b7ff2e28d53faae176776491404115ce02c;hp=ac36a6912727f3b344f358803f13834fb4291192;hpb=d2cba4d7ac11de98883968a22c16d9030d5a75dd;p=ardour.git diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc index ac36a69127..8b8219f7e2 100644 --- a/libs/pbd/stateful.cc +++ b/libs/pbd/stateful.cc @@ -35,7 +35,7 @@ #include "pbd/xml++.h" #include "pbd/error.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; @@ -44,9 +44,7 @@ namespace PBD { int Stateful::current_state_version = 0; int Stateful::loading_state_version = 0; -static void do_not_delete (void*) {} - -Glib::Threads::Private Stateful::regenerate_xml_or_string_ids (do_not_delete); +Glib::Threads::Private Stateful::_regenerate_xml_or_string_ids; Stateful::Stateful () : _extra_xml (0) @@ -385,7 +383,7 @@ bool Stateful::set_id (const XMLNode& node) { const XMLProperty* prop; - bool* regen = regenerate_xml_or_string_ids.get(); + bool* regen = _regenerate_xml_or_string_ids.get(); if (regen && *regen) { reset_id (); @@ -409,7 +407,7 @@ Stateful::reset_id () void Stateful::set_id (const string& str) { - bool* regen = regenerate_xml_or_string_ids.get(); + bool* regen = _regenerate_xml_or_string_ids.get(); if (regen && *regen) { reset_id (); @@ -418,10 +416,22 @@ Stateful::set_id (const string& str) } } +bool +Stateful::regenerate_xml_or_string_ids () const +{ + bool* regen = _regenerate_xml_or_string_ids.get(); + if (regen && *regen) { + return true; + } else { + return false; + } +} + void Stateful::set_regenerate_xml_and_string_ids_in_this_thread (bool yn) { - regenerate_xml_or_string_ids.set (&yn); + bool* val = new bool (yn); + _regenerate_xml_or_string_ids.set (val); } } // namespace PBD