Passing Struct through g_signal_connect. Segmentation Fault on exit.



This is my first attempt to write something with GTK+ and LibGlade.

When I pass a struct with my data to the function using g_signal_connect, even if i'm not doing anything with that data in the function itself (like f(){};) when I close the application I get Segmentation Fault Error.

typedef struct myStruct
{
	GtkWidget * Widget;
	gint	i;
}myStruct;

struct myStruct *p;
p->Widget = {some widget};
p->i = {some number};

g_signal_connect(G_OBJECT(BtnConnect),"clicked",G_CALLBACK(f),(gpointer)p);

How would I fix that?

Regards,

Vasili Sviridov.




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