- GenericInterface iface;
- iface = Accessibility_Accessible_queryInterface (*obj,
- interface_name,
- spi_ev ());
- return spi_object_add (iface);
+ Bonobo_Unknown iface;
+
+ if (!obj)
+ {
+ return NULL;
+ }
+
+ iface = Accessibility_Accessible_queryInterface (CSPI_OBJREF (obj),
+ interface_name,
+ cspi_ev ());
+
+
+ cspi_return_val_if_ev ("queryInterface", NULL);
+
+ /*
+ * FIXME: we need to be fairly sure that references are going
+ * to mach up if we are going to expose QueryInterface, ie. we
+ * can't allow people to do:
+ * b = a.qi ("b"); b.unref, b.unref to release a's reference.
+ * this should be no real problem though for this level of API
+ * user.
+ */
+
+ return cspi_object_add (iface);