From f996e36d6c36ae117ceaef493dbdba56dd09105f Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 26 Mar 2004 16:18:27 +0000 Subject: [PATCH] set native cursor to null at Mouse.destroy() --- src/java/org/lwjgl/input/Mouse.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/java/org/lwjgl/input/Mouse.java b/src/java/org/lwjgl/input/Mouse.java index 581d080f..7c13733c 100644 --- a/src/java/org/lwjgl/input/Mouse.java +++ b/src/java/org/lwjgl/input/Mouse.java @@ -282,11 +282,17 @@ public class Mouse { } /** - * "Destroy" the mouse. Remember to reset the native cursor if - * setNativeCursor() has been called with anything else than null. + * "Destroy" the mouse. */ public static void destroy() { - assert currentCursor == null; + if (currentCursor != null) { + try { + setNativeCursor(null); + } catch (Exception e) { + if (Sys.DEBUG) + e.printStackTrace(); + } + } if (!created) return; created = false; @@ -530,6 +536,8 @@ public class Mouse { try { setNativeCursor(currentCursor); } catch (Exception e) { + if (Sys.DEBUG) + e.printStackTrace(); } } }