[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: Should TableViewer have a dispose() method?
|
- From: jbognar@xxxxxxxxxx (James Bognar)
- Date: 7 Aug 2001 17:45:24 GMT
- Newsgroups: eclipse.tools
- Organization: http://www.eclipse.org
- User-agent: NewsPortal 0.23
Sorry...here\'s the rest of the post...
I\'m having a problem with memory leaks using TableViewer. If you run the
following bit of code, you end up with 10 ResultModel objects in memory.
(ResultModel is an implementation of IStructuredContentProvider).
for (int i = 0; i < 10; i++) {
TableViewer tb = new TableViewer(parent, SWT.NONE);
tb.setContentProvider(new ResultModel());
}
Once the table viewer looses any references to it, the
IStructuredContentProvider should be cleaned up by the gc, but it isn\'t.
It appears that this object is referenced somewhere in the internal Table.
I can clear up the objects by calling the
TableViewer.getTable().dispose() method, but I never create the Table
object myself, and therefore shouldn\'t be calling this method.
Shouldn\'t the TableViewer provide a dispose() or finalize() method to
clear up references to this object? Or is there a method in TableViewer
that I should be calling to clean up this reference?