set native cursor to null at Mouse.destroy()

This commit is contained in:
Elias Naur 2004-03-26 16:18:27 +00:00
parent 44cbb3ca02
commit f996e36d6c
1 changed files with 11 additions and 3 deletions

View File

@ -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();
}
}
}