I appreciate this patch, especially since the ticket was (incorrectly) closed as a duplicate of an unrelated ticket :) But, I don't think it addresses the OP's crash -- the retrace shows the final two steps were:
menuitem wasn't NULL in this trace, so guarding against NULL in the calling code probably won't help. In fact, ido_calendar_menu_item_set_date() is already safeguarding against NULL pointers in its first line that calls IDO_IS_CALENDAR_MENU_ITEM(). That's already null-safe -- but, unfortunately, not corrupt-pointer safe, which is why g_type_check_instance_cast() is crashing. ;)
I appreciate this patch, especially since the ticket was (incorrectly) closed as a duplicate of an unrelated ticket :) But, I don't think it addresses the OP's crash -- the retrace shows the final two steps were:
> g_type_ check_instance_ cast (type_instance= 0x2849cb0, iface_type= 42195904) menu_item_ set_date (menuitem= 0x27d7440, year=2011, month=5, day=7) at idocalendarmenu item.c: 383
> ido_calendar_
menuitem wasn't NULL in this trace, so guarding against NULL in the calling code probably won't help. In fact, ido_calendar_ menu_item_ set_date( ) is already safeguarding against NULL pointers in its first line that calls IDO_IS_ CALENDAR_ MENU_ITEM( ). That's already null-safe -- but, unfortunately, not corrupt-pointer safe, which is why g_type_ check_instance_ cast() is crashing. ;)