Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe2007-09-06 18:05:13 +0000
committerBogdan Gheorghe2007-09-06 18:05:13 +0000
commitd8947875759e0246ff44218b206ca9e13a5e628d (patch)
tree0959642413c16f7877f5dbbe4907d5bcff39060f
parent1b2fa5437e45cf640786433cad700cc54c2d8ed8 (diff)
downloadeclipse.platform.swt-d8947875759e0246ff44218b206ca9e13a5e628d.tar.gz
eclipse.platform.swt-d8947875759e0246ff44218b206ca9e13a5e628d.tar.xz
eclipse.platform.swt-d8947875759e0246ff44218b206ca9e13a5e628d.zip
201373 SIGSEGV in Printer.getPrinterList
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index 5a1d25a9c4..4196579d75 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -73,6 +73,13 @@ public static PrinterData[] getPrinterList() {
if (OS.GTK_VERSION < OS.VERSION (2, 10, 0) || disablePrinting) {
return printerList;
}
+ if (!OS.g_thread_supported ()) {
+ OS.g_thread_init (0);
+ }
+ OS.gtk_set_locale();
+ if (!OS.gtk_init_check (new int /*long*/ [] {0}, null)) {
+ SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
+ }
Callback printerCallback = new Callback(Printer.class, "GtkPrinterFunc_List", 2); //$NON-NLS-1$
int /*long*/ GtkPrinterFunc_List = printerCallback.getAddress();
if (GtkPrinterFunc_List == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);
@@ -113,6 +120,13 @@ public static PrinterData getDefaultPrinterData() {
if (OS.GTK_VERSION < OS.VERSION (2, 10, 0) || disablePrinting) {
return null;
}
+ if (!OS.g_thread_supported ()) {
+ OS.g_thread_init (0);
+ }
+ OS.gtk_set_locale();
+ if (!OS.gtk_init_check (new int /*long*/ [] {0}, null)) {
+ SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
+ }
Callback printerCallback = new Callback(Printer.class, "GtkPrinterFunc_Default", 2); //$NON-NLS-1$
int /*long*/ GtkPrinterFunc_Default = printerCallback.getAddress();
if (GtkPrinterFunc_Default == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);

Back to the top