Click here to Skip to main content
15,895,799 members
Home / Discussions / C#
   

C#

 
GeneralHTML FORMULAR Pin
buzman7-Dec-03 2:12
buzman7-Dec-03 2:12 
GeneralRe: HTML FORMULAR Pin
Heath Stewart7-Dec-03 4:48
protectorHeath Stewart7-Dec-03 4:48 
GeneralRe: HTML FORMULAR Pin
Alexander Kent7-Dec-03 16:28
Alexander Kent7-Dec-03 16:28 
QuestionHow can I remove all references to an object? Pin
bzurer7-Dec-03 1:57
bzurer7-Dec-03 1:57 
AnswerRe: How can I remove all references to an object? Pin
Heath Stewart7-Dec-03 4:43
protectorHeath Stewart7-Dec-03 4:43 
GeneralRe: How can I remove all references to an object? Pin
bzurer7-Dec-03 5:16
bzurer7-Dec-03 5:16 
GeneralRe: How can I remove all references to an object? Pin
Heath Stewart7-Dec-03 10:18
protectorHeath Stewart7-Dec-03 10:18 
GeneralRe: How can I remove all references to an object? Pin
Paul Evans8-Dec-03 6:55
Paul Evans8-Dec-03 6:55 
bz - You are thinking about it too much. If you keep a list of yet more references to an object that you want to be destroyed it will never disappear.

Think un-C++, think dirty, think c#. Leave it null and let it be. That's all you are contracted to do memory management wise in C#.

I suggest that if you have it as part of a collection, you first remove the reference from the collection, and then nullify whatever else points to it (including the temp variable).

It's a pain, but you don't get much control over the GC, and MS would have you believe it's better that way.

If you've just done a big batch remove process, probably worth while calling GC.Collect.

It often takes two passes of the GC for the physical memory to be actually freed up though (first makes it a weak reference, second destroys).

/**********************************
Paul Evans, Dorset, UK.
Personal Homepage "EnjoySoftware" @
http://www.enjoysoftware.co.uk/
**********************************/

GeneralRe: How can I remove all references to an object? Pin
bzurer8-Dec-03 7:24
bzurer8-Dec-03 7:24 
Generalfile menu and toolbar Pin
steve_rm6-Dec-03 19:25
steve_rm6-Dec-03 19:25 
GeneralRe: file menu and toolbar Pin
leppie6-Dec-03 22:19
leppie6-Dec-03 22:19 
GeneralRe: file menu and toolbar Pin
Heath Stewart7-Dec-03 4:36
protectorHeath Stewart7-Dec-03 4:36 
GeneralIUrlHistory Interfaces Pin
Dave Conn6-Dec-03 18:44
Dave Conn6-Dec-03 18:44 
GeneralRe: IUrlHistory Interfaces Pin
Heath Stewart7-Dec-03 4:52
protectorHeath Stewart7-Dec-03 4:52 
GeneralVisual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
Chris Morrison6-Dec-03 18:26
Chris Morrison6-Dec-03 18:26 
GeneralRe: Visual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
jparsons6-Dec-03 22:25
jparsons6-Dec-03 22:25 
GeneralRe: Visual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
Nick Parker7-Dec-03 4:46
protectorNick Parker7-Dec-03 4:46 
GeneralRe: Visual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
Chris Morrison7-Dec-03 5:04
Chris Morrison7-Dec-03 5:04 
GeneralRe: Visual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
Heath Stewart7-Dec-03 10:27
protectorHeath Stewart7-Dec-03 10:27 
GeneralRe: Visual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
Nick Parker7-Dec-03 10:51
protectorNick Parker7-Dec-03 10:51 
GeneralRe: Visual Studio AddIn problem - adding a sub-menu to the Edit menu Pin
Heath Stewart7-Dec-03 10:55
protectorHeath Stewart7-Dec-03 10:55 
GeneralAbout Journal--hook Pin
lajiyo6-Dec-03 16:21
lajiyo6-Dec-03 16:21 
GeneralRe: About Journal--hook Pin
leppie6-Dec-03 22:13
leppie6-Dec-03 22:13 
GeneralInfinite Recursion and other odd errors with Network API wrapper Pin
bri189a6-Dec-03 15:14
bri189a6-Dec-03 15:14 
GeneralRe: Infinite Recursion and other odd errors with Network API wrapper Pin
leppie6-Dec-03 22:11
leppie6-Dec-03 22:11 

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.