weak-references
Are multiple weak references to the same object cleared in groups?
If I have multiple weak references pointing at the same object, and no stron开发者_JS百科g references are around. Can I be sure both weak references are intact when one of them returns the object?Weak[详细]
2023-03-13 10:59 分类:问答Thread safety of Java example using WeakReference
I am reading up on weak references in Java after seing a SO post and realising I didn\'t really know what they were.[详细]
2023-03-13 10:48 分类:问答Pros and Cons of Listeners as WeakReferences
What are the pros and cons of keeping listeners as WeakReferences? The big \'Pro\' of course is that: Adding a listener as a WeakR开发者_StackOverfloweference means the listener doesn\'t need to bothe[详细]
2023-03-12 10:59 分类:问答How to remove a weakReference from a list?
I\'ve got a list of weakReferences to objects in java. How do i write a method that gets the real object instance and removes it\'s weak reference from this list?[详细]
2023-03-11 23:22 分类:问答GC Doesn't Delete Circular References in WeakKeyDictionaries?
I have a situation in which I\'d like to maintain a mapping from one object to another for as long as the first object exists. My first thought was to use a WeakKeyDictionary.[详细]
2023-03-10 07:17 分类:问答How to prevent GC to collect weakly referenced object?
I have开发者_StackOverflow社区 an object cache that internally uses weak references and sometimes my object get GCed even if I still need it (so it need to be reload again).[详细]
2023-03-09 05:17 分类:问答Block garbage collector while analyzing weak references
I\'m experimenting with WeakReference, and I\'m writing a code that checks if a weak reference is valid before returning a strong reference to the object.[详细]
2023-03-09 00:19 分类:问答How can I maintain a weak reference on a COM object in C++?
In my application, I\'m hooking various functions for creating COM objects (such as CoCreateInstanceEx) to get notified whenever some object is created. I\'m keeping track of all created objects in a[详细]
2023-03-08 09:50 分类:问答EXC_BAD_ACCESS on objc_setAssociatedObject with -weak_library /usr/lib/libSystem.B.dylib linker flags
I have a EXC_BAD_ACCESS when I call objc_setAssociatedObject with the linker flags : -weak_library /usr/lib/libSystem.B.dylib linker flags.[详细]
2023-03-06 01:23 分类:问答Best time to cull WeakReferences in a collection in .NET
I have a collection (I\'m writing a Weak Dictionary) and I need to cull the dead WeakReferences periodically. What I\'ve usually seen is checks in the Add and Remove methods that say, \"After X modifi[详细]
2023-02-28 19:52 分类:问答