Click here to Skip to main content
14,386,420 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Super Lloyd14-May-19 21:32
MemberSuper Lloyd14-May-19 21:32 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch15-May-19 4:38
Memberhoney the codewitch15-May-19 4:38 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Super Lloyd14-May-19 20:12
MemberSuper Lloyd14-May-19 20:12 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch14-May-19 20:29
Memberhoney the codewitch14-May-19 20:29 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Super Lloyd14-May-19 20:40
MemberSuper Lloyd14-May-19 20:40 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
johannesnestler15-May-19 5:09
Memberjohannesnestler15-May-19 5:09 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch15-May-19 6:17
Memberhoney the codewitch15-May-19 6:17 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch14-May-19 18:44
Memberhoney the codewitch14-May-19 18:44 
Adding, I hope you never count on those finalizers being called.

Designing your code such that they are dependant on them in any way is terrible design.

If I want to truly manage the disposal of objects, I'll keep a list of them and track them myself.

That's the proper way to do it.

Always
Call
Dispose.

On any disposable interface. If you don't do it assume you are leaking

If you want to use that additional set aside GC list for finalization be my guest, but your users are WRONG if they ever write code that needs it.

And I'd rather ASSERT that sort of wrong then try to manage it, because of the other problems i mentioned.

Consider this: - and I've done this on a web server in the real world and learned the hard way - which is one of the reasons i don't use finalize anymore!

Create GDI ico handles by using shell calls.

Forget to call dispose on a few of them, but implement finalizers.

I'll bet you my next check you run out of GDI handles and your system just stops producing more.

Until you restart the webserver

This is WITH your finalizers.

At least if you ASSERT you'll eventually get a debug on what happened.

I learned the hard way.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

GeneralRe: Some thoughts on the .net CLR/CLI Pin
Gerardo Orozco15-May-19 9:00
MemberGerardo Orozco15-May-19 9:00 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch15-May-19 9:08
Memberhoney the codewitch15-May-19 9:08 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
PIEBALDconsult14-May-19 7:21
professionalPIEBALDconsult14-May-19 7:21 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch14-May-19 7:42
Memberhoney the codewitch14-May-19 7:42 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
PIEBALDconsult14-May-19 8:51
professionalPIEBALDconsult14-May-19 8:51 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Sander Rossel14-May-19 10:07
professionalSander Rossel14-May-19 10:07 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch14-May-19 10:26
Memberhoney the codewitch14-May-19 10:26 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Dan Neely14-May-19 10:32
MemberDan Neely14-May-19 10:32 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch14-May-19 13:15
Memberhoney the codewitch14-May-19 13:15 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Dan Neely14-May-19 15:09
MemberDan Neely14-May-19 15:09 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch14-May-19 15:26
Memberhoney the codewitch14-May-19 15:26 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Gary R. Wheeler14-May-19 13:43
MemberGary R. Wheeler14-May-19 13:43 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch14-May-19 14:15
Memberhoney the codewitch14-May-19 14:15 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Member 916705714-May-19 23:04
MemberMember 916705714-May-19 23:04 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Eddy Vluggen15-May-19 1:58
mveEddy Vluggen15-May-19 1:58 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
honey the codewitch15-May-19 4:37
Memberhoney the codewitch15-May-19 4:37 
GeneralRe: Some thoughts on the .net CLR/CLI Pin
Member 798912215-May-19 4:30
MemberMember 798912215-May-19 4:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.