summaryrefslogtreecommitdiff
path: root/libs/pbd/stateful.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-11-16 21:23:39 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-11-16 21:24:10 -0500
commite1dc2d46042af61ae045eb49568e9284453c9e12 (patch)
tree9c911373b159183243f7c5225018d9543aa3e44c /libs/pbd/stateful.cc
parent9694dfc8d2eec173a61d678c14fa45df2f284a06 (diff)
correct value testing for Stateful thread-private variable controlling ID regeneration
Diffstat (limited to 'libs/pbd/stateful.cc')
-rw-r--r--libs/pbd/stateful.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc
index 628594891b..92314e1e53 100644
--- a/libs/pbd/stateful.cc
+++ b/libs/pbd/stateful.cc
@@ -44,9 +44,9 @@ namespace PBD {
int Stateful::current_state_version = 0;
int Stateful::loading_state_version = 0;
-static void do_not_delete (void*) { }
+static void regular_delete (void* p) { bool* bp = reinterpret_cast<bool*> (p); delete bp; std::cerr << "Deleted RSSI bool\n"; }
-Glib::Threads::Private<bool> Stateful::regenerate_xml_or_string_ids (do_not_delete);
+Glib::Threads::Private<bool> Stateful::regenerate_xml_or_string_ids (regular_delete);
Stateful::Stateful ()
: _extra_xml (0)
@@ -385,8 +385,9 @@ bool
Stateful::set_id (const XMLNode& node)
{
const XMLProperty* prop;
+ bool* regen = regenerate_xml_or_string_ids.get();
- if (regenerate_xml_or_string_ids.get()) {
+ if (regen && *regen) {
reset_id ();
return true;
}
@@ -408,7 +409,9 @@ Stateful::reset_id ()
void
Stateful::set_id (const string& str)
{
- if (regenerate_xml_or_string_ids.get()) {
+ bool* regen = regenerate_xml_or_string_ids.get();
+
+ if (regen && *regen) {
reset_id ();
} else {
_id = str;