hobbit_yurka (hobbit_yurka) wrote in gtk,
hobbit_yurka
hobbit_yurka
gtk

different Glib versions ?

reading "Official Gnome 2 Developer's Guide" :
g_propagate_error(error_dest,error_src)
if the destination isn't NULL this function simply copies the source to the destination .
However , if the destination is an act NULL , the function frees the source error .

i.e. if error_dest not NULL just copy error_src to error_dest else deallocate error_src .

ok . let's try :
g_set_error(one_error,HOBBIT_ERROR,HOBBIT_ERROR_PANIC, "HOBBIT_ERROR_PANIC \n");

just do smtng

g_set_error(two_error,QUARK_ERROR,QUARK_ERROR_NO_INPUT, "QUARK_ERROR_NO_INPUT : %s\n", (g_quark_to_string(q)==0)?"TRUE":"FALSE");

just do smtng

g_propagate_error(one_error,another_error);



trying to run applicatin and getting the output:
(process:3196): GLib-WARNING **: GError set over the top of a previous GError or
uninitialized memory.

This indicates a bug in someone's code. You must ensure an error is NULL before it's
set.
The overwriting error message was: QUARK_ERROR_NO_INPUT quark = FALSE


and if i'll put g_error_free(*one_error);
*one_error = NULL;

before g_propagate_error(one_error,another_error);
everything is OK .

what's wrong ? different Glibs' versions?
  • Post a new comment

    Error

    default userpic
  • 6 comments