Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- is there a way to recycle a complex java object once the GC has decided it is unreachable
- SmartPointer<ObjType> object = pool.getObject(); // hold reference
- // ... do stuff with object over time.
- object = nullptr; // that is when reference
- // count goes to 0
- SomeReference r = referenceQueue.getReference();
- pool.recycle(r.takeBackUnusedObjectFromGC()); // ??????????????????????????
Advertisement
Add Comment
Please, Sign In to add comment