Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-07-27 07:58:43 +0000
committerAndrey Loskutov2018-07-27 07:58:43 +0000
commit69f64942e41085ef7106d4e3b9e33d5e1087473e (patch)
treeaf38e1e7e69ccee9caaba47e3a7c3cef1236c1db
parent91cef84d181a3ed1b4a2c91526b558b2c87e5a77 (diff)
downloadeclipse.platform.swt-69f64942e41085ef7106d4e3b9e33d5e1087473e.tar.gz
eclipse.platform.swt-69f64942e41085ef7106d4e3b9e33d5e1087473e.tar.xz
eclipse.platform.swt-69f64942e41085ef7106d4e3b9e33d5e1087473e.zip
Bug 532632 - enable "fast" widgetTable checks by default
Change-Id: Ib06c96cc501fa717dcf757bb7d36224bedd14354 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java2
2 files changed, 6 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 61ab5bbef1..66cddf2c72 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -822,10 +822,8 @@ void addWidget (long /*int*/ handle, Widget widget) {
freeSlot = indexTable[oldSlot];
// Mark old index slot as used
indexTable [oldSlot] = SLOT_IN_USE;
- if(strictChecks) {
- if(widgetTable [oldSlot] != null) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, ". Trying to override non empty slot with " + widget + debugInfoForIndex(oldSlot));
- }
+ if(widgetTable [oldSlot] != null) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, ". Trying to override non empty slot with " + widget + debugInfoForIndex(oldSlot));
}
widgetTable [oldSlot] = widget;
}
@@ -4941,7 +4939,7 @@ Widget removeWidget (long /*int*/ handle) {
Widget widget = null;
int index;
long /*int*/ data = OS.g_object_get_qdata (handle, SWT_OBJECT_INDEX) - 1;
- if(strictChecks && (data < 0 || data > Integer.MAX_VALUE)) {
+ if(data < 0 || data > Integer.MAX_VALUE) {
SWT.error(SWT.ERROR_INVALID_RETURN_VALUE, null, ". g_object_get_qdata returned unexpected index value" + debugInfoForIndex(data));
}
index = (int)data;
@@ -4952,13 +4950,11 @@ Widget removeWidget (long /*int*/ handle) {
freeSlot = index;
OS.g_object_set_qdata (handle, SWT_OBJECT_INDEX, 0);
- if(strictChecks && widget == null) {
+ if(widget == null) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, ". Widget already released" + debugInfoForIndex(index));
}
} else {
- if(strictChecks) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, ". Invalid index for handle " + handle + debugInfoForIndex(index));
- }
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, ". Invalid index for handle " + handle + debugInfoForIndex(index));
}
return widget;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index 2b1ba79ff8..319d775ea7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -2730,7 +2730,7 @@ void updateMinimized (boolean minimized) {
void deregister () {
super.deregister ();
Widget disposed = display.removeWidget (shellHandle);
- if(Display.strictChecks && !(disposed instanceof Shell)) {
+ if(shellHandle != 0 && !(disposed instanceof Shell)) {
SWT.error(SWT.ERROR_INVALID_RETURN_VALUE, null, ". Wrong widgetTable entry: " + disposed + " removed for shell: " + this + display.dumpWidgetTableInfo());
}
if(Display.strictChecks) {

Back to the top