Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
GeneralRe: Releasing Memory Pin
Guffa28-Sep-05 9:03
Guffa28-Sep-05 9:03 
GeneralRe: Releasing Memory Pin
Dave Kreskowiak28-Sep-05 9:36
mveDave Kreskowiak28-Sep-05 9:36 
GeneralRe: Releasing Memory Pin
dbetting28-Sep-05 11:04
dbetting28-Sep-05 11:04 
GeneralRe: Releasing Memory Pin
Dave Kreskowiak28-Sep-05 11:16
mveDave Kreskowiak28-Sep-05 11:16 
GeneralRe: Releasing Memory Pin
dbetting28-Sep-05 12:13
dbetting28-Sep-05 12:13 
GeneralRe: Releasing Memory Pin
Dave Kreskowiak28-Sep-05 14:30
mveDave Kreskowiak28-Sep-05 14:30 
GeneralRe: Releasing Memory Pin
dbetting29-Sep-05 1:51
dbetting29-Sep-05 1:51 
GeneralRe: Releasing Memory Pin
Dave Kreskowiak29-Sep-05 11:59
mveDave Kreskowiak29-Sep-05 11:59 
dbetting wrote:
Setting didn't seem to be worth anything to me but one of my contractors insisted it was necessary. Every time he does an object.Dispose(), the next line is object = null.

How much are you paying him? Laugh | :laugh: No, it's not necessary.

Objects that go out of scope, or can't be reached on any code path, are killed, or nulled if you wish, automatically by the Garbage Collector.


dbetting wrote:
To my knowledge, the only way to use unmanaged memory/code is to explicitly code it and block it into an unmanaged code block. I don't do that anywhere. If there is a way to use unmanaged memory inadvertantly, let me know what the key words are that I need to be looking for and I can focus on those.

There are no keyword to be looking for. The .NET Framework is essentially a large collection of classes that wraps a good deal the Win32 API. For instance, the Windows.Form class wraps a Win32 Window, which has an unmanaged window handle behind it. Calling .Dispose() on your .NET Framework Form object releases that unmanaged handle.

You're using unmanaged resources whether you explicitly do so yourself or not. An easy way to do release them is to make sure you call .Dispose() on any objects that expose this method, when your done with them.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Releasing Memory Pin
Dan Neely29-Sep-05 2:10
Dan Neely29-Sep-05 2:10 
QuestionCopy a Row from one DataView to another? Pin
thomasa28-Sep-05 2:38
thomasa28-Sep-05 2:38 
AnswerRe: Copy a Row from one DataView to another? Pin
Wjousts28-Sep-05 9:24
Wjousts28-Sep-05 9:24 
QuestionObfuscator - Crytografy code Pin
horacyjr28-Sep-05 1:47
horacyjr28-Sep-05 1:47 
AnswerRe: Obfuscator - Crytografy code Pin
Colin Angus Mackay28-Sep-05 2:33
Colin Angus Mackay28-Sep-05 2:33 
GeneralRe: Obfuscator - Crytografy code Pin
horacyjr28-Sep-05 3:27
horacyjr28-Sep-05 3:27 
QuestionModify app.config Pin
Talktorajeev28-Sep-05 1:47
Talktorajeev28-Sep-05 1:47 
QuestionHelp needed with cookies and WebRequest Pin
nzmike28-Sep-05 1:13
nzmike28-Sep-05 1:13 
AnswerRe: Help needed with cookies and WebRequest Pin
Guffa28-Sep-05 2:18
Guffa28-Sep-05 2:18 
GeneralRe: Help needed with cookies and WebRequest Pin
nzmike28-Sep-05 17:15
nzmike28-Sep-05 17:15 
GeneralRe: Help needed with cookies and WebRequest Pin
Guffa29-Sep-05 22:06
Guffa29-Sep-05 22:06 
QuestionRemoving PropertyGrid border Pin
Rob Cooper28-Sep-05 0:35
Rob Cooper28-Sep-05 0:35 
QuestionNightmare!!! Pin
sean_mufc28-Sep-05 0:12
sean_mufc28-Sep-05 0:12 
AnswerRe: Nightmare!!! Pin
Russell Jones28-Sep-05 4:19
Russell Jones28-Sep-05 4:19 
AnswerRe: Nightmare!!! Pin
Russell Jones28-Sep-05 4:20
Russell Jones28-Sep-05 4:20 
QuestionSend MouseWeel event to another control Pin
nedel27-Sep-05 22:33
nedel27-Sep-05 22:33 
QuestionSaving RTF Pin
Greeky27-Sep-05 21:40
Greeky27-Sep-05 21:40 

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.