Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 77695 - Printer resources not disposed; SWT runs out of handles
Summary: Printer resources not disposed; SWT runs out of handles
Status: RESOLVED DUPLICATE of bug 24796
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-03 12:12 EST by Christian Damus CLA
Modified: 2004-11-04 10:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2004-11-03 12:12:52 EST
The Linux-GTK implementation of SWT does not appear to release all OS resources
when disposing an org.eclipse.swt.printing.Printer object.

The following code snippet results in a "No more handles" SWT error:

	Display.getDefault().syncExec(new Runnable() {
		public void run() {
			for (int i = 0; i < 100; i++) {
				Printer printer = new Printer();
				printer.dispose();
			}
		}
	});

The stack trace looks like:

org.eclipse.swt.SWTError: No more handles
	at org.eclipse.swt.SWT.error(SWT.java:2717)
	at org.eclipse.swt.SWT.error(SWT.java:2616)
	at org.eclipse.swt.SWT.error(SWT.java:2587)
	at org.eclipse.swt.printing.Printer.<init>(Printer.java:100)
	at org.eclipse.swt.printing.Printer.<init>(Printer.java:77)
	at com.example.MyPlugin$1.run(PetalUIPlugin.java:106)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:135)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:25)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:3022)
	at com.example.MyPlugin.doStartup(PetalUIPlugin.java:102)
        ...

This code manifests no problems on Windows platforms.

Configuration:

Platform:  Intel x86 32-bit dual-processor
OS:        RedHat Linux 9 (Shrike)
WS:        GTK
Eclipse:   3.0.1
JVM:       java version "1.4.2"
           IBM J9SE VM (build 2.2, J2RE 1.4.2 IBM J9 2.2 Linux x86-32
               j9xia32142-2040917 (JIT enabled)
           J9VM - 20040916_0910_1HdSMR
           JIT  - r7_level20040915_1801
Comment 1 Steve Northover CLA 2004-11-04 10:36:05 EST
Printing is not implemented on GTK.
Comment 2 Steve Northover CLA 2004-11-04 10:36:51 EST

*** This bug has been marked as a duplicate of 24796 ***