Hello,
I try to call
g_io_scheduler_push_job(job_func, ¶m, NULL, G_PRIORITY_HIGH, generator_cancellable);
In my C/gtk+ application for runing job_func in another thread then main program. But have segfault when i call this function, and debugger sad that: ** userdata attempt to difference a generic pointer**
My job_func:
gboolean job_func(GIOSchedulerJob *job, GCancellable *cancellable, gpointer user_data)
{
JobParam* job_param = (JobParam*)user_data;
build(NULL, job_param->mw);
return TRUE;
}
Where JobParam:
typedef struct _JobParam
{
GtkWidget* widget;
MainWin* mw;
}JobParam;
Where MainWin:
typedef struct _MainWin
{
GtkWindow parent;
GtkWidget* scroll;
GtkWidget* box;
GtkUIManager *uimanager;
} MainWin;
And build:
void build(GtkWidget* widget, MainWin* mw) { gtk_list_store_clear(mw->model); }
How can i fix it?
Thank you