Make ARDOUR::init safer.
git-svn-id: svn://localhost/ardour2/branches/3.0@5950 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
da85f65ec0
commit
c71f419920
@ -312,14 +312,16 @@ int main (int argc, char *argv[])
|
|||||||
fixup_bundle_environment ();
|
fixup_bundle_environment ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Glib::thread_init();
|
if (!Glib::thread_supported())
|
||||||
|
Glib::thread_init();
|
||||||
|
|
||||||
gtk_set_locale ();
|
gtk_set_locale ();
|
||||||
|
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
/* this does some magic that is needed to make GTK and Wine's own
|
/* this does some magic that is needed to make GTK and Wine's own
|
||||||
X11 client interact properly.
|
X11 client interact properly.
|
||||||
*/
|
*/
|
||||||
gui_init (&argc, &argv);
|
gui_init (&argc, &argv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(void) bindtextdomain (PACKAGE, localedir);
|
(void) bindtextdomain (PACKAGE, localedir);
|
||||||
@ -380,7 +382,7 @@ int main (int argc, char *argv[])
|
|||||||
cerr << _("Cannot install SIGPIPE error handler") << endl;
|
cerr << _("Cannot install SIGPIPE error handler") << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ui = new ARDOUR_UI (&argc, &argv);
|
ui = new ARDOUR_UI (&argc, &argv);
|
||||||
} catch (failed_constructor& err) {
|
} catch (failed_constructor& err) {
|
||||||
error << _("could not create ARDOUR GUI") << endmsg;
|
error << _("could not create ARDOUR GUI") << endmsg;
|
||||||
|
@ -308,6 +308,11 @@ lotsa_files_please ()
|
|||||||
int
|
int
|
||||||
ARDOUR::init (bool use_vst, bool try_optimization)
|
ARDOUR::init (bool use_vst, bool try_optimization)
|
||||||
{
|
{
|
||||||
|
if (!Glib::thread_supported())
|
||||||
|
Glib::thread_init();
|
||||||
|
|
||||||
|
PBD::ID::init ();
|
||||||
|
|
||||||
extern void setup_enum_writer ();
|
extern void setup_enum_writer ();
|
||||||
|
|
||||||
(void) bindtextdomain(PACKAGE, LOCALEDIR);
|
(void) bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
Glib::thread_init ();
|
|
||||||
PBD::ID::init ();
|
|
||||||
ARDOUR::init (false, false);
|
ARDOUR::init (false, false);
|
||||||
|
|
||||||
CppUnit::TestResult testresult;
|
CppUnit::TestResult testresult;
|
||||||
|
@ -38,7 +38,8 @@ uint64_t ID::_counter = 0;
|
|||||||
void
|
void
|
||||||
ID::init ()
|
ID::init ()
|
||||||
{
|
{
|
||||||
counter_lock = new Glib::Mutex;
|
if (!counter_lock)
|
||||||
|
counter_lock = new Glib::Mutex;
|
||||||
}
|
}
|
||||||
|
|
||||||
ID::ID ()
|
ID::ID ()
|
||||||
|
Loading…
Reference in New Issue
Block a user