GcrCertificateWidget::certificate not really NULL-able
@tintou There seems to be a flaw in the new GcrCertificateWidget::certificate
. It claims to be NULL-able, but the first thing I get with widget = gcr_certificate_widget_new (NULL);
(which is useful to have the widget ready for later setting of the certificate) is a flood of runtime warnings starting with:
(evolution:313397): Gcr-CRITICAL **: 23:16:01.923: gcr_certificate_get_der_data: assertion 'GCR_IS_CERTIFICATE (self)' failed
at g_logv() at gmessages.c:1335
by g_log() at gmessages.c:1494
by gcr_certificate_get_der_data() at gcr-certificate.c:409
by gcr_certificate_widget_set_certificate() at gcr-certificate-widget.c:556
by gcr_certificate_widget_set_property() at gcr-certificate-widget.c:85
by object_set_property() at gobject.c:1722
by g_object_new_internal() at gobject.c:2143
by g_object_new_valist() at gobject.c:2441
by g_object_new() at gobject.c:1935
by gcr_certificate_widget_new() at gcr-certificate-widget.c:512
by init_certs() at e-contact-editor.c:3571
by init_all() at e-contact-editor.c:3880
by e_contact_editor_init() at e-contact-editor.c:5060
by g_type_create_instance() at gtype.c:1938
by g_object_new_internal() at gobject.c:2093
by g_object_new_valist() at gobject.c:2441
by g_object_new() at gobject.c:1935
by e_contact_editor_new() at e-contact-editor.c:5352
The current gcr_certificate_widget_set_certificate
also clears the certificate under its hands and then dereferences/uses it:
void
gcr_certificate_widget_set_certificate (GcrCertificateWidget *self, GcrCertificate *certificate)
{
...
g_set_object (&self->certificate, certificate);
data = gcr_certificate_get_der_data (self->certificate, &n_data);
if (!data) {
g_set_object (&self->certificate, NULL);
}
icon = gcr_certificate_get_icon (self->certificate);