Re: GLib_CRITICAL: g_io_channel_new_file() / win32
- From: Jan-Marek Glogowski <glogow fbihome de>
- To: "F. Kater" <f kater2 gmx net>
- Cc: GTK App Devel List <gtk-app-devel-list gnome org>
- Subject: Re: GLib_CRITICAL: g_io_channel_new_file() / win32
- Date: Sat, 11 Sep 2004 14:51:52 +0200 (CEST)
Hi
All function using GError return a new allocated GError object. There are
many examples on GError usage in the GLib Docs -> Core Application Support
-> Error Reporting.
{
GError *x1_gerror = NULL;
GIOChannel *x1_giochannel;
x1_giochannel =
g_io_channel_new_file( "./test.txt", "r", &x1_gerror);
if( x1_giochannel == NULL ) {
// Do your error stuff
if( x1_gerror != NULL )
g_print( "%s\n", x1_gerror->message );
goto free_error;
}
// Do your normal stuff
g_object_unref( x1_giochannel );
free_error:
if( x1_gerror != NULL )
g_error_free( x1_gerror );
}
Jan-Marek
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]