g_io_scheduler_job_send_to_mainloop How to?



Hello,

I use g_io_scheduler_job_send_to_mainloop function for running
functiton in another thread:

void build_thumbnails(GtkWidget* widget, MainWin* mw)
{       
        printf("BUILD!!!");
}

I have structure for func parameters:

typedef struct _JobParam
{
  GtkWidget* widget;
  struct MainWin  *mw;
}JobParam;

job func:

gboolean job_func(GIOSchedulerJob *job, GSourceFunc func, gpointer
user_data, GDestroyNotify notify)
{       
        JobParam* job_param = (JobParam*)user_data;     
        build_thumbnails(NULL, job_param->mw);
        return TRUE;
}

And try to call:

void loading(....)
{
 g_io_scheduler_job_send_to_mainloop(job,(GSourceFunc)job_func,&param, g_free);
}

I get error: g_io_scheduler_job_send_to_mainloop: assertion 'job != NULL' failed

What's wrong. How can i fix it?

Thank you.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]