13
0

Make ARDOUR::init safer.

git-svn-id: svn://localhost/ardour2/branches/3.0@5950 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-10-27 18:00:45 +00:00
parent da85f65ec0
commit c71f419920
4 changed files with 15 additions and 9 deletions

View File

@ -312,14 +312,16 @@ int main (int argc, char *argv[])
fixup_bundle_environment ();
#endif
Glib::thread_init();
if (!Glib::thread_supported())
Glib::thread_init();
gtk_set_locale ();
#ifdef VST_SUPPORT
/* this does some magic that is needed to make GTK and Wine's own
X11 client interact properly.
*/
gui_init (&argc, &argv);
/* this does some magic that is needed to make GTK and Wine's own
X11 client interact properly.
*/
gui_init (&argc, &argv);
#endif
(void) bindtextdomain (PACKAGE, localedir);
@ -380,7 +382,7 @@ int main (int argc, char *argv[])
cerr << _("Cannot install SIGPIPE error handler") << endl;
}
try {
try {
ui = new ARDOUR_UI (&argc, &argv);
} catch (failed_constructor& err) {
error << _("could not create ARDOUR GUI") << endmsg;

View File

@ -308,6 +308,11 @@ lotsa_files_please ()
int
ARDOUR::init (bool use_vst, bool try_optimization)
{
if (!Glib::thread_supported())
Glib::thread_init();
PBD::ID::init ();
extern void setup_enum_writer ();
(void) bindtextdomain(PACKAGE, LOCALEDIR);

View File

@ -9,8 +9,6 @@
int
main()
{
Glib::thread_init ();
PBD::ID::init ();
ARDOUR::init (false, false);
CppUnit::TestResult testresult;

View File

@ -38,7 +38,8 @@ uint64_t ID::_counter = 0;
void
ID::init ()
{
counter_lock = new Glib::Mutex;
if (!counter_lock)
counter_lock = new Glib::Mutex;
}
ID::ID ()