summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-07-28 20:54:43 +0200
committerRobin Gareus <robin@gareus.org>2015-07-28 20:54:43 +0200
commit36f6aa9356331e82e8710621e0f492223bc0231b (patch)
tree2f21b883d74a88a56cc67f99822a710c796f03a9
parent64af6c880ca2248ecae764340d3da9d4ffa3736b (diff)
work-around OSX loadlocale thread safety.
This is not a real fix; just a stop-gap for the worst offender. iostream on OSX is not thread safe. Sadly no crash report so far managed to catch the 2nd thread in action. looks like the GUI thread is preempted, 2nd thread succeeds, and the crash occurs later). see also https://discussions.apple.com/thread/3479591 crash in s << c->internal_to_user (c->get_value ()); ardour-4.1.335(5000,0x7fff777f5300) malloc: *** error for object 0x7fe2f3e06170: pointer being freed was not allocated 1 libsystem_c.dylib abort + 129 2 libsystem_malloc.dylib free + 428 3 libsystem_c.dylib __numeric_load_locale + 544 4 libsystem_c.dylib loadlocale + 216 5 libstdc++.6.dylib std::__convert_from_v(int* const&, char*, int, char const*, ...) + 193 6 libstdc++.6.dylib std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const + 193 7 libstdc++.6.dylib std::ostream& std::ostream::_M_insert<double>(double) + 221 8 ardour-4.1.335 ProcessorEntry::Control::set_tooltip() + 854 (processor_box.cc:578) 9 ardour-4.1.335 ProcessorEntry::Control::control_changed() + 446 (processor_box.cc:637) 10 ibpbd.dylib PBD::StandardTimer::on_elapsed()
-rw-r--r--gtk2_ardour/processor_box.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index a059f32a05..409409c68f 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -568,18 +568,14 @@ ProcessorEntry::Control::set_tooltip ()
if (!c) {
return;
}
-
- stringstream s;
- s << _name << ": ";
+ char tmp[256];
if (c->toggled ()) {
- s << (c->get_value() > 0.5 ? _("on") : _("off"));
+ snprintf (tmp, sizeof(tmp), "%sX %s", _name.c_str(), c->get_value() > 0.5 ? _("on") : _("off"));
} else {
- s << setprecision(2) << fixed;
- s << c->internal_to_user (c->get_value ());
+ snprintf (tmp, sizeof(tmp), "%sX %.2f", _name.c_str(), c->internal_to_user (c->get_value ()));
}
- string sm = Glib::Markup::escape_text (s.str());
-
+ string sm = Glib::Markup::escape_text (tmp);
_slider_persistant_tooltip.set_tip (sm);
ARDOUR_UI::instance()->set_tip (_button, sm);
}