Click here to Skip to main content
15,879,326 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Dave Kreskowiak18-Mar-09 10:45
mveDave Kreskowiak18-Mar-09 10:45 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
led mike19-Mar-09 4:33
led mike19-Mar-09 4:33 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Pete O'Hanlon19-Mar-09 12:57
mvePete O'Hanlon19-Mar-09 12:57 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
led mike20-Mar-09 4:37
led mike20-Mar-09 4:37 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Dave Kreskowiak19-Mar-09 14:04
mveDave Kreskowiak19-Mar-09 14:04 
AnswerRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Simon P Stevens18-Mar-09 6:51
Simon P Stevens18-Mar-09 6:51 
QuestionSiteLock template on C# Pin
budarin17-Mar-09 11:57
budarin17-Mar-09 11:57 
QuestionIDisposable, Inheritance and Event Handlers Pin
Alex Feature17-Mar-09 9:36
Alex Feature17-Mar-09 9:36 
Hey Dudes (Dudets),

I read this awesome article IDisposable: What Your Mother Never Told You About Resource Deallocation[^] and a bunch of other not so awesome ones.

However, I failed to find an answer to this question:

1. I got a base class - ObjectA that inherits from a UserControl.

2. ObjectA is then inherited from by ObjectB and tailored to particular uses elsewhere in the code. (ObjectB is not inherited from)

3. There are many different ObjectB implementations (ObjectB1....10) all of which add EventHandlers for ObjectA events and declare their own distinct events that are handled by other objects.

4. Now all ObjectBx objects are stored in a collection and then disposed off like so:

For Each oA as ObjectA in CollectionOfObjectBx
    oA.Dispose
Next


5. Each ObjectBx overloads Dispose method and uses it to Remove EventHandlers.

However, these Dispose overloads never get called because instances of the ObjectBx are disposed via the base class that is not aware of anything going on inside inherited objects.

But does it matter? Want GC eventually kill off all handlers since the objects themselves are dead?


I would greatly appreciate if anyone could shed some light on this.


Regards
Alex

"All your base are belong to us..."

- Mr. Cats (2110 A.D.)

AnswerRe: IDisposable, Inheritance and Event Handlers Pin
Natza Mitzi17-Mar-09 10:02
Natza Mitzi17-Mar-09 10:02 
GeneralRe: IDisposable, Inheritance and Event Handlers Pin
Alex Feature17-Mar-09 21:07
Alex Feature17-Mar-09 21:07 
GeneralRe: IDisposable, Inheritance and Event Handlers Pin
Alex Feature18-Mar-09 2:07
Alex Feature18-Mar-09 2:07 
GeneralRe: IDisposable, Inheritance and Event Handlers Pin
Natza Mitzi18-Mar-09 3:30
Natza Mitzi18-Mar-09 3:30 
AnswerRe: IDisposable, Inheritance and Event Handlers Pin
S. Senthil Kumar19-Mar-09 3:53
S. Senthil Kumar19-Mar-09 3:53 
QuestionProblem in creating website with CMS Pin
itsravie17-Mar-09 5:37
itsravie17-Mar-09 5:37 
AnswerPick a forum and stick with it. Pin
Pete O'Hanlon17-Mar-09 6:07
mvePete O'Hanlon17-Mar-09 6:07 
GeneralRe: Pick a forum and stick with it. Pin
led mike17-Mar-09 8:06
led mike17-Mar-09 8:06 
AnswerRe: Problem in creating website with CMS Pin
led mike17-Mar-09 8:08
led mike17-Mar-09 8:08 
QuestionISSue with VS 2005 Pin
p_196016-Mar-09 22:38
p_196016-Mar-09 22:38 
Questioninvisible watermark in MS word files Pin
Ayesha Manzoor16-Mar-09 6:40
Ayesha Manzoor16-Mar-09 6:40 
AnswerRe: invisible watermark in MS word files Pin
0x3c016-Mar-09 6:52
0x3c016-Mar-09 6:52 
GeneralRe: invisible watermark in MS word files Pin
Ayesha Manzoor24-Mar-09 1:30
Ayesha Manzoor24-Mar-09 1:30 
AnswerRe: invisible watermark in MS word files Pin
led mike17-Mar-09 4:22
led mike17-Mar-09 4:22 
GeneralRe: invisible watermark in MS word files Pin
Ayesha Manzoor24-Mar-09 2:01
Ayesha Manzoor24-Mar-09 2:01 
GeneralRe: invisible watermark in MS word files Pin
led mike24-Mar-09 6:59
led mike24-Mar-09 6:59 
AnswerRe: invisible watermark in MS word files [modified] Pin
P13RC324-Mar-09 14:52
P13RC324-Mar-09 14:52 

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.