Fixed issue #21.
Fixed issue #21.

The problem here is that, as @reboot pointed out, when we call "ref.clear()",
it prevents the reference from getting enqueued. So they stick around forever
in ComThread.liveComObjects even though they are actually dead.

I think this fix is simpler than the proposed fix from @guykv in
https://github.com/kohsuke/com4j/pull/21. The added delay in updating
ComThread.liveComObjects is a non-issue because NativePointerPhantomReference
does not own any sizable objects native or Java.

This regression was introduced in b5143cebdcc25110f54a3e7ea02bb12d8d449a65.
See 33e03e862d8f5ab635337d28c939f226e85108ec for the discussion that led to it.

kohsuke/com4j,archiecobbs/com4j,archiecobbs/com4j,archiecobbs/com4j,kohsuke/com4j,kohsuke/com4j,archiecobbs/com4j,kohsuke/com4j