DECREF in the right places.]]] */
DECREF in the right places.  Logged as bugzilla bug 319646.]]] */
static PyObject *core_module_registerEventListener (PyObject *self,						    PyObject *args) { 	GQuark type_quark;	CORBA_Environment ev;	PyObject *listener;	char *event_name;	EventListener *el;	GSList *listener_list;	if (!core_check_init ()) {		return NULL;	}	/* Get the arguments.	 */	if (!PyArg_ParseTuple (args, 			       "Os:registerEventListener", 			       &listener, 			       &event_name)) {		return NULL;	}	Py_INCREF (listener); /* [[[TODO: WDW - check to make sure we				 DECREF in the right places.]]] */	/* Do we already have a listener registered for this event type? 	 */        type_quark = g_quark_from_string (event_name);	el = g_hash_table_lookup (listeners, (gpointer) type_quark);	if (!el) {		/* Create the bonobo event listener and register it with		 * at-spi.		 */		listener_list = g_slist_prepend (NULL, listener);		el = event_listener_new (queue, NULL, listener_list);		CORBA_exception_init (&ev);		Accessibility_Registry_registerGlobalEventListener (			registry,			bonobo_object_corba_objref (BONOBO_OBJECT(el)),			event_name,			&ev);		/* If an exception was thrown, return an error 		 */		if (ev._major != CORBA_NO_EXCEPTION) {			/* [[[TODO: WDW - finalize/free el (which also			 * frees up listener_list and DECREF			 * listener?)			 */			CORBA_exception_free (&ev);			PyErr_SetString (				PyExc_RuntimeError, 				"Couldn't register event listener with at-spi");			return NULL;		} else {			CORBA_exception_free (&ev);			g_hash_table_insert (listeners, 					     (gpointer) type_quark, 					     el);		}	} else {		el->pylisteners = g_slist_append (el->pylisteners, listener);	}	return PyInt_FromLong (1);}