Guest User

Untitled

a guest
May 9th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. is there a way to recycle a complex java object once the GC has decided it is unreachable
  2. SmartPointer<ObjType> object = pool.getObject(); // hold reference
  3.  
  4. // ... do stuff with object over time.
  5.  
  6. object = nullptr; // that is when reference
  7. // count goes to 0
  8.  
  9. SomeReference r = referenceQueue.getReference();
  10.  
  11. pool.recycle(r.takeBackUnusedObjectFromGC()); // ??????????????????????????
Advertisement
Add Comment
Please, Sign In to add comment