提交 554790a7 编写于 作者: D denis

7030062: duplicate free

Reviewed-by: dcherepanov
上级 ee5f71da
...@@ -74,7 +74,7 @@ ifeq ($(PLATFORM), linux) ...@@ -74,7 +74,7 @@ ifeq ($(PLATFORM), linux)
# volatile to prevent the optimization. However, this approach does not # volatile to prevent the optimization. However, this approach does not
# work because we have to declare all variables as volatile in result. # work because we have to declare all variables as volatile in result.
OTHER_CFLAGS += -Wno-clobbered # OTHER_CFLAGS += -Wno-clobbered
endif endif
include $(BUILDDIR)/common/Mapfile-vers.gmk include $(BUILDDIR)/common/Mapfile-vers.gmk
......
...@@ -466,6 +466,10 @@ public abstract class Toolkit { ...@@ -466,6 +466,10 @@ public abstract class Toolkit {
*/ */
protected void loadSystemColors(int[] systemColors) protected void loadSystemColors(int[] systemColors)
throws HeadlessException { throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
} }
/** /**
...@@ -500,6 +504,10 @@ public abstract class Toolkit { ...@@ -500,6 +504,10 @@ public abstract class Toolkit {
*/ */
public void setDynamicLayout(boolean dynamic) public void setDynamicLayout(boolean dynamic)
throws HeadlessException { throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
} }
/** /**
...@@ -523,6 +531,9 @@ public abstract class Toolkit { ...@@ -523,6 +531,9 @@ public abstract class Toolkit {
*/ */
protected boolean isDynamicLayoutSet() protected boolean isDynamicLayoutSet()
throws HeadlessException { throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
if (this != Toolkit.getDefaultToolkit()) { if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().isDynamicLayoutSet(); return Toolkit.getDefaultToolkit().isDynamicLayoutSet();
} else { } else {
...@@ -558,6 +569,9 @@ public abstract class Toolkit { ...@@ -558,6 +569,9 @@ public abstract class Toolkit {
*/ */
public boolean isDynamicLayoutActive() public boolean isDynamicLayoutActive()
throws HeadlessException { throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
if (this != Toolkit.getDefaultToolkit()) { if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().isDynamicLayoutActive(); return Toolkit.getDefaultToolkit().isDynamicLayoutActive();
} else { } else {
...@@ -601,6 +615,9 @@ public abstract class Toolkit { ...@@ -601,6 +615,9 @@ public abstract class Toolkit {
*/ */
public Insets getScreenInsets(GraphicsConfiguration gc) public Insets getScreenInsets(GraphicsConfiguration gc)
throws HeadlessException { throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
if (this != Toolkit.getDefaultToolkit()) { if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().getScreenInsets(gc); return Toolkit.getDefaultToolkit().getScreenInsets(gc);
} else { } else {
...@@ -1342,6 +1359,9 @@ public abstract class Toolkit { ...@@ -1342,6 +1359,9 @@ public abstract class Toolkit {
* @since 1.4 * @since 1.4
*/ */
public Clipboard getSystemSelection() throws HeadlessException { public Clipboard getSystemSelection() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
if (this != Toolkit.getDefaultToolkit()) { if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().getSystemSelection(); return Toolkit.getDefaultToolkit().getSystemSelection();
} else { } else {
...@@ -1371,6 +1391,10 @@ public abstract class Toolkit { ...@@ -1371,6 +1391,10 @@ public abstract class Toolkit {
* @since JDK1.1 * @since JDK1.1
*/ */
public int getMenuShortcutKeyMask() throws HeadlessException { public int getMenuShortcutKeyMask() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
return Event.CTRL_MASK; return Event.CTRL_MASK;
} }
...@@ -1499,6 +1523,9 @@ public abstract class Toolkit { ...@@ -1499,6 +1523,9 @@ public abstract class Toolkit {
*/ */
public Dimension getBestCursorSize(int preferredWidth, public Dimension getBestCursorSize(int preferredWidth,
int preferredHeight) throws HeadlessException { int preferredHeight) throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
// Override to implement custom cursor support. // Override to implement custom cursor support.
if (this != Toolkit.getDefaultToolkit()) { if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit(). return Toolkit.getDefaultToolkit().
...@@ -1526,6 +1553,9 @@ public abstract class Toolkit { ...@@ -1526,6 +1553,9 @@ public abstract class Toolkit {
* @since 1.2 * @since 1.2
*/ */
public int getMaximumCursorColors() throws HeadlessException { public int getMaximumCursorColors() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
// Override to implement custom cursor support. // Override to implement custom cursor support.
if (this != Toolkit.getDefaultToolkit()) { if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().getMaximumCursorColors(); return Toolkit.getDefaultToolkit().getMaximumCursorColors();
...@@ -2572,6 +2602,9 @@ public abstract class Toolkit { ...@@ -2572,6 +2602,9 @@ public abstract class Toolkit {
* @since 1.7 * @since 1.7
*/ */
public boolean areExtraMouseButtonsEnabled() throws HeadlessException { public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
if (GraphicsEnvironment.isHeadless()){
throw new HeadlessException();
}
return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled(); return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled();
} }
} }
...@@ -136,7 +136,7 @@ awt_mgrsel_select(const char *selname, long extra_mask, ...@@ -136,7 +136,7 @@ awt_mgrsel_select(const char *selname, long extra_mask,
|| per_scr_owners == NULL || mgrsel == NULL) || per_scr_owners == NULL || mgrsel == NULL)
{ {
DTRACE_PRINTLN("MG: select: unable to allocate memory"); DTRACE_PRINTLN("MG: select: unable to allocate memory");
if (namesbuf != NULL) free(per_scr_atoms); if (namesbuf != NULL) free(namesbuf);
if (names != NULL) free(names); if (names != NULL) free(names);
if (per_scr_atoms != NULL) free(per_scr_atoms); if (per_scr_atoms != NULL) free(per_scr_atoms);
if (per_scr_owners != NULL) free(per_scr_owners); if (per_scr_owners != NULL) free(per_scr_owners);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册