[maemo-developers] delete-event processing of GtkWindow causes cordump

From: Zhu, Peter J peter.j.zhu at intel.com
Date: Mon Jul 23 19:13:25 EEST 2007
Cumming,


I just redid the test.c in my env and it work now. But if using Hildon,
it crashes as before. Please help try this and use:
gcc crash_hildon_test.c `pkg-config --cflags --libs hildon-1` to build
and run. 

The code is attached.  

Murray Cumming wrote:
> On Mon, 2007-07-23 at 22:50 +0800, Zhu, Peter J wrote:
>> static gboolean delete_event_cb( GtkWidget *widget,
>>                               GdkEvent  *event,
>>                               gpointer   data ) {
>>    return FALSE;
>> }
>> int main(int argc, char *argv[]) {
>> 	GtkWidget* window;
>> 
>> 	gtk_init(&argc, &argv);
>> 	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
>> 	gtk_widget_show_all(GTK_WIDGET(window));
>>             g_signal_connect(G_OBJECT(window), "delete_event",
>>       G_CALLBACK(delete_event_cb), NULL);
>> 	gtk_main();
>> 	return 0;
>> }
>> 
>> 
>> it crashes if click X of uppoer right corner. If that delete-event
>> callback returns TRUE, it behaves like normal. You might note that it
>> doesn't use any hildon specialized function. But it just crashes in
>> hildon enviroment.
> 
> I don't get a crash. I'm attaching a file that actually compiles (I
> added the include).
> 
> I'm building it like so:
> gcc test.c `pkg-config gtk+-2.0 --cflags --libs`
> 
> And then running it like so, in an x86 maemo scratchbox target:
> run-standalone.sh ./a.out
> 
> In general, you should try using gdb or valgrind when something
> crashes. However, if this simple test case crashes then it suggests
> that something is very wrong with your installation.
> 
> --
> Murray Cumming
> murrayc at murrayc.com
> www.murrayc.com
> www.openismus.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash_hildon_test.c
Type: application/octet-stream
Size: 719 bytes
Desc: crash_hildon_test.c
Url : http://lists.maemo.org/pipermail/maemo-developers/attachments/20070724/b3253138/attachment.obj 
More information about the maemo-developers mailing list