From: Philip Chimento Date: Sat, 31 Aug 2013 21:07:08 +0000 (-0700) Subject: Use g_thread_try_new() instead of g_thread_create() X-Git-Url: https://git.stderr.nl/gitweb?p=projects%2Fchimara%2Fchimara.git;a=commitdiff_plain;h=94d1ecd9f71ed033a7905bcc142c5173d44ae9eb Use g_thread_try_new() instead of g_thread_create() g_thread_create() was deprecated in GLib 2.32. We don't use g_thread_new() because the program should not abort if the thread could not be created; rather, it should display an error message and refuse to start the game. --- diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index dd057e6..793c6e8 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -1297,8 +1297,8 @@ chimara_glk_run(ChimaraGlk *glk, const gchar *plugin, int argc, char *argv[], GE g_object_notify(G_OBJECT(glk), "program-name"); /* Run in a separate thread */ - priv->thread = g_thread_create((GThreadFunc)glk_enter, startup, TRUE, error); - + priv->thread = g_thread_try_new("glk", (GThreadFunc)glk_enter, startup, error); + return !(priv->thread == NULL); }