Structure.clear() should invoke ensureAllocated() before accessing "memory". Given:
public class Foo extends Structure
{
public volatile Pointer one;
public Foo()
{
setFieldOrder(new String[]{"one"});
clear();
}
}
What will happen is:
- Structure initializes memory to a AutoAllocated buffer
- setFieldOrder() sets memory to null
- clear() uses memory before ensuring it is allocated, throwing NullPointerException
Structure.clear() should invoke ensureAllocated() before accessing "memory". Given:
What will happen is: