Commit d845fef9 authored by Bryce Allen's avatar Bryce Allen Committed by Youness Alaoui

Do not unref the GThread since g_thread_join takes the reference. Also rename the variable.

parent d34e48d0
......@@ -68,7 +68,7 @@ static void * example_thread(void *data);
int
main(int argc, char *argv[])
{
GThread *gloopthread;
GThread *gexamplethread;
// Parse arguments
if (argc > 4 || argc < 2 || argv[1][1] != '\0') {
......@@ -97,13 +97,12 @@ main(int argc, char *argv[])
// Run the mainloop and the example thread
exit_thread = FALSE;
gloopthread = g_thread_new("example thread", &example_thread, NULL);
gexamplethread = g_thread_new("example thread", &example_thread, NULL);
g_main_loop_run (gloop);
exit_thread = TRUE;
g_main_loop_unref(gloop);
g_thread_join (gloopthread);
g_thread_unref (gloopthread);
g_thread_join (gexamplethread);
return EXIT_SUCCESS;
}
......
......@@ -77,7 +77,7 @@ static void * example_thread(void *data);
int
main(int argc, char *argv[])
{
GThread *gloopthread;
GThread *gexamplethread;
// Parse arguments
if (argc > 4 || argc < 2 || argv[1][1] != '\0') {
......@@ -106,13 +106,12 @@ main(int argc, char *argv[])
// Run the mainloop and the example thread
exit_thread = FALSE;
gloopthread = g_thread_new("example thread", &example_thread, NULL);
gexamplethread = g_thread_new("example thread", &example_thread, NULL);
g_main_loop_run (gloop);
exit_thread = TRUE;
g_main_loop_unref(gloop);
g_thread_join (gloopthread);
g_thread_unref (gloopthread);
g_thread_join (gexamplethread);
return EXIT_SUCCESS;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment