We use the "consumer" property of the ShutdownClient class to store a
proxy in the NSC code and a skeleton in the NSM dummy code. When
releasing the consumer in shutdown_client_finalize(), we may therefor
not cast to a ShutdownConsumerSkeleton unconditionally; otherwise
the NSM dummy will segfault when releasing ShutdownClient objects.
/* release the consumer, if we have one */
if (client->consumer != NULL)
{
- g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (client->consumer));
- g_object_unref (client->consumer);
+ if (IS_SHUTDOWN_CONSUMER_SKELETON (client->consumer))
+ g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (client->consumer));
+ g_object_unref (client->consumer);
}
(*G_OBJECT_CLASS (shutdown_client_parent_class)->finalize) (object);