+2006-03-20 Bill Haneman <bill.haneman@sun.com>
+
+ * libspi/table.c:
+ (impl_get_selected_rows): Don't free the selection if it's
+ empty or has not been assigned; init it to NULL so you can tell.
+ Also, allow for zero selected rows.
+ (impl_getSelectedColumns): Ditto. Bug #319088.
+
2006-03-11 Vincent Untz <vuntz@gnome.org>
Leak fix for bug #334217.
impl_getSelectedRows (PortableServer_Servant servant,
CORBA_Environment *ev)
{
- gint *selectedRows;
+ gint *selectedRows = NULL;
gint length;
Accessibility_LongSeq *retval;
AtkTable *table = get_table_from_servant (servant);
length = atk_table_get_selected_rows (table, &selectedRows);
- bonobo_return_val_if_fail (length > 0, NULL, ev);
+ bonobo_return_val_if_fail (length >= 0, NULL, ev);
retval = Accessibility_LongSeq__alloc ();
retval->_maximum = retval->_length = length;
retval->_buffer[length] = selectedRows[length];
}
- g_free (selectedRows);
+ if (selectedRows) g_free (selectedRows);
return retval;
}
impl_getSelectedColumns (PortableServer_Servant servant,
CORBA_Environment *ev)
{
- gint *selectedColumns;
+ gint *selectedColumns = NULL;
gint length;
Accessibility_LongSeq *retval;
AtkTable *table = get_table_from_servant (servant);
retval->_buffer[length] = (CORBA_long) selectedColumns[length];
}
- g_free (selectedColumns);
+ if (selectedColumns) g_free (selectedColumns);
return retval;
}