public abstract class Handle
extends java.lang.Object
It is very important that the close method be called
after the object is no longer needed to free memory allocated by
native code. Not calling close can result in memory
leaks, and possibly even crash the Java VM.
Most toolkit users will not need to use this class directly.
| Modifier and Type | Field and Description |
|---|---|
protected long |
m_handle
The value of the handle.
|
| Constructor and Description |
|---|
Handle() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearHandle()
Clears the handle without freeing memory.
|
abstract void |
close()
Close the handle, releasing the memory allocated by native functions.
|
boolean |
equals(java.lang.Object anotherHandle)
Equals method, for debugging purposes.
|
void |
finalize()
Attempts to release the handle owned by this object.
|
long |
getHandle()
Returns the actual handle represented by this object.
|
int |
hashCode()
hashCode method, for debugging purposes.
|
public abstract void close()
It is okay to call this method multiple times on the same object.
public long getHandle()
public void clearHandle()
public boolean equals(java.lang.Object anotherHandle)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void finalize()
throws java.lang.Throwable
close
method when a handle is no longer required. This method is a
"last resort" to attempt to prevent memory leaks.finalize in class java.lang.Objectjava.lang.Throwable