|
If nothing has a strong reference to MyTextBox, then yeah, it could get GC'ed. Thats why its called a WeakReference. Why would you use a WeakReference here anyways?
|
|
|
|
|
Making it weak reference will not prevent GC to play it's role. It's static. If it's not weak reference strong references of hundreds of textboxes in my app get polluted. I just bother with the textboxes that are really alive.
|
|
|
|
|
If you're relying on the reference being there, then you either need something that can recreate the reference when needed, or you need to maintain a strong reference.
|
|
|
|
|
I just bother with the textboxes that are really alive.
|
|
|
|
|
Objects of type MyTextBox will be collected if there are no strong references to them and, of course, the GC performs a garbage collection. mList dictionary will not be collected becouse there is a static strong reference to it, unless you clear this reference. I guess you have a static method or property to access the contents of mList Dictionary, becouse if you don't this dictionary is completely useless, and I don't see how you should need it unless MyTextBox class was much more heavy than it seems to be.
|
|
|
|
|
thomus07 wrote: private static Dictionary<intptr, weakreference="">
What do you think is going to happen with that IntPtr when the GC collects the TextBox?
|
|
|
|
|
How to extract any object from the image after convert it's to black and white.
|
|
|
|
|
If the image is of a top hat I might be able to extract a rabbit from it, otherwise it beyond my abilities.
|
|
|
|
|
Boom tish!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
a
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Ramkumar_S wrote: a
aa
|
|
|
|
|
|
Were you proposing to post a reply, with each letter in a separate message?
If so, this could take a while...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
So you think being abrupt and rude will get you an answer? Good luck with that.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
What is the difference between an orange?
|
|
|
|
|
DAMN YOU! You beat me to it! (But I still have to give you a 5.)
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
what's the color of an orange on a black & white image?
|
|
|
|
|
How many bits ?
|
|
|
|
|
I have no idea, the OP didn't specify. Do you also need the size or origin of the orange?
|
|
|
|
|
Luc Pattyn wrote: Do you also need the size or origin of the orange?
I'm guessing that a pip was involved somewhere. Definitely a tree was involved.
|
|
|
|
|
And how do you grow a black&white tree out of an orange? And will it bear orange fruit again?
|
|
|
|
|
|
|
That was my first thought, then I thought I'd ask him a poser first. The OP really miss-timed this one, due to the holiday he's still pretty high up the list, so he is getting more univotes.
|
|
|
|