From bf52cef16fd2cc1ad83f760059d27f49f036c3eb Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 3 Apr 2008 20:28:32 +0000 Subject: Made sure that curl_global_init is called in all the multithreaded example programs. --- docs/examples/smooth-gtk-thread.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs/examples/smooth-gtk-thread.c') diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 271939cea..2d41aa248 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -33,7 +33,7 @@ pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; int j = 0; gint num_urls = 9; /* Just make sure this is less than urls[]*/ -char *urls[]= { +const char * const urls[]= { "90022", "90023", "90024", @@ -58,7 +58,6 @@ void *pull_one_url(void *NaN) CURLcode res; gchar *http; FILE *outfile; - gint i; /* Stop threads from entering unless j is incremented */ pthread_mutex_lock(&lock); @@ -167,7 +166,9 @@ static gboolean cb_delete(GtkWidget *window, gpointer data) int main(int argc, char **argv) { GtkWidget *top_window, *outside_frame, *inside_frame, *progress_bar; - GtkAdjustment *adj; + + /* Must initialize libcurl before any threads are started */ + curl_global_init(CURL_GLOBAL_ALL); /* Init thread */ g_thread_init(NULL); -- cgit v1.2.3