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=b52bdc5cb7ecd5674a3f40cdd50de615289a583e 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 337cfa5..33c64e8 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -1236,8 +1236,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); }