Dnia 25-07-2005, pon o godzinie 15:21 +0100, Tim Müller napisał(a):
> On Monday 25 July 2005 10:14, Uzytkownik wrote:
> 
> > #define TEST(name, cau) g_print(#name "...\t%s\n", cau ? "OK" : "Fail")
> 
> > TEST(Init, parser = g_object_new(WOC_PAGER_PARSER_TYPE, NULL));
> >  g_print("%p\n", parser->scanner);
> >  g_object_unref(parser);
> >    ...
> > It's print address, but after it's error of memory.
> >   ...
> > What do I do wrong? finalize isn't calling
> 
> You've shot yourself in the foot with that macro. Here's a hint - try this:
> 
>   g_print ("%s\n", parser->scanner);
> 
> and then think about why that prints "OK" and what exactly your macro expands 
> to ... :-P
> 

I'm stupid :) - I didn't remember "Be careful with macros"
This is what is wrong :)
Now all it's OK.

> Cheers
>  -Tim
> 
> PS: it should work as expected if you put brackets around the cau in the 
> macro 
> definition

I forgot it.

Thank you very much.

Best regards.


-- 
W�ochy i Pary� - przewodniki turystyczne do wyboru. Tylko z lipcowym numerem 
miesi�cznika Auto+. 
http://www.a-plus.pl
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to